<?php

class PollsController extends AppController {

    var $name = "Polls";

    public function edit($id = null) {
        $this->layout = "ajax";
        $proyect_id = $this->Session->read('proy_id');
        $this->set('usuario', $this->Auth->user());
        if ($proyect_id == "") {
            $this->Session->setFlash('No ha seleccionado Proyecto');
            $this->redirect(array('controller' => 'Proyects', 'action' => 'index'));
        } elseif (($this->Session->read('fase1') == 1) OR ($this->Session->read('fase1') == 2)) {
            $this->set('grupo', $this->Auth->user('group_id'));
            if (empty($this->data)) {
                $this->Poll->recursive = -1;
                $this->data = $this->Poll->find('first', array('conditions' => array('Poll.id' => $id), 'fields' => array('Poll.id', 'Poll.visto_bueno', 'Poll.observaciones', 'Poll.verificacion_fase_uno', 'Poll.visto_bueno', 'Poll.tiene_proyecto_productivo', 'Poll.tipo_proyecto', 'Poll.servidumbre_aguas', 'Poll.servidumbre_transito', 'Poll.servidumbre_otras', 'Poll.concepto_social', 'Poll.calificacion_economicos', 'Poll.concepto_economico', 'Poll.calificacion_ambientales', 'Poll.concepto_ambiental', 'Poll.estado', 'Poll.aprobacion')));
                $this->set('visto_bueno', $this->data['Poll']['visto_bueno']);
            } else {
                if ($this->Poll->saveAll($this->data)) {
                    $this->Session->setFlash('Encuesta Editada con éxito');
                    $this->redirect(array('controller' => 'Polls', 'action' => 'edit', $id));
                } else {
                    $this->set('visto_bueno', $this->data['Poll']['visto_bueno']);
                }
            }
        } else {
            $this->Session->setFlash('Este Proyecto No Superó Fase Uno');
            $this->redirect(array('controller' => 'Pages', 'action' => 'display'));
        }
    }

    public function add($proyect_id) {
        $cantidad = $this->Poll->find('count', array('conditions' => array('Poll.proyect_id' => $proyect_id)));

        if ($cantidad < 2) {
            $this->data['Poll']['proyect_id'] = $proyect_id;
            $this->data['Poll']['id'] = null;
            if ($this->Poll->saveAll($this->data)) {
                $this->Session->setFlash('Encuesta creada con éxito');
                $this->redirect(array('controller' => 'Polls', 'action' => 'index'));
            }
        } else {
            $this->Session->setFlash('Ya existe una encuesta para este proyecto.');
            $this->redirect(array('controller' => 'Polls', 'action' => 'index'));
        }
    }

    function select() {
        $this->set('cities', $this->Poll->City->find('list', array(
                    'order' => 'name ASC',
                    'conditions' => array('City.departament_id' => $this->data['Poll']['departamento'])
                        )
                ));
        $this->set('usuario', $this->Auth->user());
    }

    function visto_bueno($id) {
        $this->layout = "ajax";
        if (empty($this->data)) {
            $this->data = $this->Poll->find('first', array('conditions' => array('Poll.id' => $id), 'fields' => array('Poll.visto_bueno', 'Poll.descripcion_visto_bueno')));
            $this->set('usuario', $this->Auth->user());
        } else {
            if ($this->data['Poll']['visto_bueno'] == 'No' and ($this->data['Poll']['descripcion_visto_bueno'] == "" or empty($this->data['Poll']['descripcion_visto_bueno']))) {
                $this->Session->setFlash('Si selecciona No, debe ingresar un concepto.');
                $this->set('usuario', $this->Auth->user());
            } else {
                if ($this->Poll->saveAll($this->data)) {
                    $this->Session->setFlash('Visto bueno guardado');
                    $this->set('usuario', $this->Auth->user());
                } else {
                    $this->Session->setFlash('Error guardando datos');
                }
            }
        }
    }

    function verificacion_fase_uno($id) {
        if (empty($this->data)) {
            $this->data = $this->Poll->find('first', array('conditions' => array('Poll.id' => $id), 'fields' => array('Poll.verificacion_fase_uno', 'Poll.descripcion_verificacion_fase_uno')));
            $this->set('usuario', $this->Auth->user());
        } else {
            if ($this->data['Poll']['verificacion_fase_uno'] == 'No' and ($this->data['Poll']['descripcion_verificacion_fase_uno'] == "" or empty($this->data['Poll']['descripcion_verificacion_fase_uno']))) {
                $this->Session->setFlash('Si selecciona No, debe ingresar un concepto.');
                $this->set('usuario', $this->Auth->user());
            } else {
                if ($this->Poll->saveAll($this->data)) {
                    $this->Session->setFlash('Ratificación guardada');
                    $this->set('usuario', $this->Auth->user());
                }
            }
        }
    }

    function print_letter($id = null) {
        $this->layout = "pdf";
        $proyect_id = $this->Session->read('proy_id');
        $codigo = $this->Session->read('cod');
        if ($proyect_id == "") {
            $this->Session->setFlash('No ha seleccionado Proyecto');
            $this->redirect(array('controller' => 'Proyects', 'action' => 'index'));
        } else {

            $this->set('proyect_id', $proyect_id);
            $this->set('codigo', $codigo);

            //Obtengo los datos del proponente del proyecto al cual se le esta haciendo la encuesta.          
            App::import('Model', 'Proposer');

            $p = new Proposer();

            $this->set('proponente', $p->find('first', array('conditions' => array('Proposer.proyect_id' => $proyect_id), 'fields' => array('Proposer.nombre', 'Proposer.direccion', 'Proposer.telefono_fijo', 'Proposer.telefono_celular', 'Proposer.numero_identificacion'))));

            //Obtengo los datos de los aspirantes de este proyecto.

            App::import('Model', 'Candidate');

            $c = new Candidate();
            $c->recursive = -1;

            $this->set('candidatos', $c->find('all', array('conditions' => array('Candidate.proyect_id' => $proyect_id), 'fields' => array('Candidate.nro_ident', 'Candidate.1er_apellido', 'Candidate.2do_apellido', 'Candidate.1er_nombre', 'Candidate.clase', 'Candidate.clase', 'Candidate.2do_nombre', 'Candidate.estado_filtro'))));

            App::import('Model', 'Property');

            $pr = new Property();
            $pr->recursive = -1;

            $propiedades = $pr->find('all', array('conditions' => array('Property.proyect_id' => $proyect_id), 'fields' => array('Property.nombre', 'Property.city_id', 'Property.vereda', 'Property.area_titulo', 'Property.area_negociacion', 'Property.matricula', 'Property.codigo')));

            $this->set('propiedades', $propiedades);

            $this->Poll->recursive = -1;

            $this->set('encuesta', $this->Poll->find('first', array('conditions' => array('Poll.id' => $id), 'fields' => array('Poll.verificacion_fase_uno', 'Poll.descripcion_verificacion_fase_uno', 'Poll.calificacion_caracteristicas_biofisicas', 'Poll.concepto_biofisico_agrologico', 'Poll.calificacion_sociales', 'Poll.concepto_social', 'Poll.calificacion_economicos', 'Poll.concepto_economico', 'Poll.calificacion_ambientales', 'Poll.concepto_ambiental', 'Poll.descripcion_vias_internas', 'Poll.georeferenciacion', 'Poll.visto_bueno', 'Poll.descripcion_visto_bueno'))));
        }
    }

    function print_poll($id = null) {
        $this->layout = "pdf";
        $proyect_id = $this->Session->read('proy_id');
        $codigo = $this->Session->read('cod');
        if ($proyect_id == "") {
            $this->Session->setFlash('No ha seleccionado Proyecto');
            $this->redirect(array('controller' => 'Proyects', 'action' => 'index'));
        } else {

            $this->set('proyect_id', $proyect_id);
            $this->set('codigo', $codigo);

            //Obtengo los datos del proponente del proyecto al cual se le esta haciendo la encuesta.          
            App::import('Model', 'Proposer');

            $p = new Proposer();

            $this->set('proponente', $p->find('first', array('conditions' => array('Proposer.proyect_id' => $proyect_id), 'fields' => array('Proposer.nombre', 'Proposer.direccion', 'Proposer.telefono_fijo', 'Proposer.telefono_celular', 'Proposer.numero_identificacion'))));

            //Obtengo los datos de los aspirantes de este proyecto.

            App::import('Model', 'Candidate');

            $c = new Candidate();
            $c->recursive = -1;

            $this->set('candidatos', $c->find('all', array('conditions' => array('Candidate.proyect_id' => $proyect_id), 'fields' => array('Candidate.nro_ident', 'Candidate.1er_apellido', 'Candidate.2do_apellido', 'Candidate.1er_nombre', 'Candidate.clase', 'Candidate.clase', 'Candidate.2do_nombre', 'Candidate.estado_filtro'))));

            App::import('Model', 'Property');

            $pr = new Property();
            $pr->recursive = -1;

            $propiedades = $pr->find('all', array('conditions' => array('Property.proyect_id' => $proyect_id), 'fields' => array('Property.nombre', 'Property.city_id', 'Property.vereda', 'Property.area_titulo', 'Property.area_negociacion', 'Property.matricula', 'Property.codigo')));

            $this->set('propiedades', $propiedades);

            $this->Poll->recursive = -1;

            $encuesta = $this->Poll->find('first', array('conditions' => array('Poll.id' => $id)));

            $this->set('encuesta', $encuesta);

            //envio en la variable dep el nombre del departamento
            App::import('Model', 'Departament');
            $departamento = new Departament();
            $departamento->recursive = -1;

            $departamento1 = $departamento->find('first', array('conditions' => array('Departament.id' => $encuesta['Poll']['departamento'])));

            $this->set('dep', $departamento1['Departament']['name']);

            //envio en la variable ciu el nombre de la ciudad
            App::import('Model', 'City');
            $ciudad = new City();
            $ciudad->recursive = -1;

            $ciudad1 = $ciudad->find('first', array('conditions' => array('City.id' => $encuesta['Poll']['city_id'])));
            $this->set('ciu', $ciudad1['City']['name']);

            //envio los datos de las fuentes de agua de esta encuesta.
            App::import('Model', 'WaterPoll');
            $fuentesDeAgua = new WaterPoll();
            $fuentesDeAgua->recursive = 0;

            $fuentesDeAgua1 = $fuentesDeAgua->find('all', array('conditions' => array('WaterPoll.poll_id' => $id)));
            $this->set('fuentesDeAgua', $fuentesDeAgua1);

            //envio los datos de las vocaciones productivas
            App::import('Model', 'ProductiveVocation');
            $vocacionesProductivas = new ProductiveVocation();
            $vocacionesProductivas->recursive = -1;

            $vocacionesProductivas1 = $vocacionesProductivas->find('all', array('conditions' => array('ProductiveVocation.poll_id' => $id)));
            $this->set('vocacionesProductivas', $vocacionesProductivas1);

            //envio los datos de los tipos de población
            App::import('Model', 'PopulationPoll');
            $poblacion = new PopulationPoll();
            $poblacion->recursive = -1;

            $poblacion1 = $poblacion->find('all', array('conditions' => array('PopulationPoll.poll_id' => $id)));
            $this->set('poblaciones', $poblacion1);

            //envio los datos de la oferta de servicios
            App::import('Model', 'Services');
            $servicios = new Services();
            $servicios->recursive = -1;

            $servicios1 = $servicios->find('all', array('conditions' => array('Services.poll_id' => $id)));
            $this->set('servicios', $servicios1);

            //envio los datos de las actividades agricolas.
            App::import('Model', 'AgriculturalActivity');
            $actividadesAgricolas = new AgriculturalActivity();
            $actividadesAgricolas->recursive = -1;

            $actividadesAgricolas1 = $actividadesAgricolas->find('all', array('conditions' => array('AgriculturalActivity.poll_id' => $id)));
            $this->set('actividadesAgricolas', $actividadesAgricolas1);

            //envio los datos de actividades pecuarias
            App::import('Model', 'Livestock');
            $actividadesPecuarias = new Livestock();
            $actividadesPecuarias->recursive = -1;

            $actividadesPecuarias1 = $actividadesPecuarias->find('all', array('conditions' => array('Livestock.poll_id' => $id)));
            $this->set('actividadesPecuarias', $actividadesPecuarias1);

            //envio los datos de las infraestructuras
            App::import('Model', 'Infrastructure');
            $infraestructuras = new Infrastructure();
            $infraestructuras->recursive = -1;

            $infraestructuras1 = $infraestructuras->find('all', array('conditions' => array('Infrastructure.poll_id' => $id)));
            $this->set('infraestructuras', $infraestructuras1);

            //envio datos de necesidades de adecuación
            App::import('Model', 'Improvement');
            $mejoras = new Improvement();
            $mejoras->recursive = -1;

            $mejoras1 = $mejoras->find('all', array('conditions' => array('Improvement.poll_id' => $id)));
            $this->set('mejoras', $mejoras1);
        }
    }

    public function climate($id = null) {
        $this->set('grupo', $this->Auth->user('group_id'));
        if (empty($this->data)) {
            $this->Poll->recursive = -1;
            $this->data = $this->Poll->find('first', array('conditions' => array('Poll.id' => $id), 'fields' => array('Poll.altura_minima_predio', 'Poll.visto_bueno', 'Poll.altura_minima_predio', "Poll.temperatura_minima", 'Poll.temperatura_promedio', "Poll.temperatura_maxima", "Poll.altura_maxima_predio", "Poll.piso_termico", "Poll.precipitacion", "Poll.meses_invierno", "Poll.meses_verano", "Poll.tiene_concecion_aguas", "Poll.requiere_concecion_aguas", "Poll.id")));
            $this->set('visto_bueno', $this->data['Poll']['visto_bueno']);
        } else {
            if ($this->Poll->saveAll($this->data)) {
                $this->Session->setFlash('Encuesta Editada con éxito');
                $this->redirect(array('controller' => 'Polls', 'action' => 'climate', $id));
            } else {
                $this->set('visto_bueno', $this->data['Poll']['visto_bueno']);
            }
        }
    }

    function soils($id = null) {
        $this->set('grupo', $this->Auth->user('group_id'));
        if (empty($this->data)) {
            $this->Poll->recursive = -1;
            $this->data = $this->Poll->find('first', array('conditions' => array('Poll.id' => $id), 'fields' => array('Poll.proyecto_estudio_suelos', 'Poll.tipo_suelo', 'Poll.area_no_utilizable', 'Poll.area_pedregosidad', 'Poll.area_salinidad', 'Poll.area_otras', 'Poll.area_erosion', 'Poll.area_inundabilidad', "Poll.area_otras_descripcion", 'Poll.visto_bueno', "Poll.id")));
            $this->set('visto_bueno', $this->data['Poll']['visto_bueno']);
        } else {
            if ($this->Poll->saveAll($this->data)) {
                $this->Session->setFlash('Encuesta Editada con éxito');
                $this->redirect(array('controller' => 'Polls', 'action' => 'soils', $id));
            } else {
                $this->set('visto_bueno', $this->data['Poll']['visto_bueno']);
            }
        }
    }

    function generals($id = null) {
        App::Import('model', 'Departament');
        $dp = new Departament();
        $this->set('departamentos', $departaments = $dp->find('list', array('fields' => array('id', 'name'))));
        $this->set('grupo', $this->Auth->user('group_id'));
        if (empty($this->data)) {
            $this->Poll->recursive = -1;
            ///eliminacion de campo inutil. OA
            $this->data = $this->Poll->find('first', array('conditions' => array('Poll.id' => $id), 'fields' => array('Poll.id', 'Poll.telefono_proponente', 'Poll.email_proponente', 'Poll.distancia_centro_urbano_km', 'Poll.vocacion_productiva_pecuaria', 'Poll.vocacion_productiva_forestal', 'Poll.vocacion_productiva_acuicola', 'Poll.tipo_vocacion_productiva_otra', 'Poll.vocacion_productiva_agricola', 'Poll.distancia_centro_comercializacion_km', 'Poll.distancia_centro_comercializacion_horas', 'Poll.distancia_centro_urbano_horas', 'Poll.departamento', 'Poll.visto_bueno', 'Poll.vereda', 'Poll.city_id', 'Poll.numero_predios', 'Poll.area_predios', 'Poll.numero_familias', 'Poll.nombre_predios', 'Poll.lindero_norte', 'Poll.lindero_sur', 'Poll.lindero_oriente', 'Poll.lindero_occidente', 'Poll.georeferenciacion', 'Poll.primer_nombre_proponente', 'Poll.segundo_nombre_proponente', 'Poll.primer_apellido_proponente', 'Poll.segundo_apellido_proponente', 'Poll.tipo_proponente', 'Poll.direccion_proponente', 'Poll.telefono_proponente', 'Poll.email_proponente', 'Poll.zona_predio', 'Poll.zona_predio_otra', 'Poll.origen_predio', 'Poll.origen_predio_otro', 'Poll.matricula_inmobililaria', 'Poll.cedula_catastral', 'Poll.primer_nombre_propietario', 'Poll.segundo_nombre_propietario', 'Poll.primer_apellido_propietario', 'Poll.segundo_apellido_propietario', 'Poll.numero_identificacion_propietario', 'Poll.tipo_vocacion_productiva_otra', 'Poll.proyect_id', 'Poll.vias_acceso', 'Poll.tiene_vias_internas', 'Poll.descripcion_vias_internas', 'Poll.distancia_centro_urbano_horas', 'Poll.distancia_via_principal_km', 'Poll.distancia_via_principal_horas')));
            $this->set('ciudades', $this->Poll->City->find('list', array('conditions' => array('City.departament_id' => $this->data['Poll']['departamento']), 'fields' => array('City.id', 'City.name'))));
            $this->set('visto_bueno', $this->data['Poll']['visto_bueno']);
        } else {
            if ($this->Poll->saveAll($this->data)) {
                $this->Session->setFlash('Encuesta Editada con éxito');
                $this->redirect(array('controller' => 'Polls', 'action' => 'generals', $id));
            }
        }
    }

    public function conditions($id = null) {
        $this->set('grupo', $this->Auth->user('group_id'));
        if (empty($this->data)) {
            $this->Poll->recursive = -1;
            $this->data = $this->Poll->find('first', array('conditions' => array('Poll.id' => $id), 'fields' => array('Poll.id', 'Poll.visto_bueno', 'Poll.interes_de_habitar', 'Poll.descripcion_interes_de_habitar', 'Poll.numero_familias_desean_habitar', 'Poll.numero_viviendas_actuales', 'Poll.numero_familias_habitan_casa_propia', 'Poll.numero_familias_habitan_casa_arriendo', 'Poll.numero_familias_habitan_casa_familiar', 'Poll.numero_familias_habitan_casa_amigo', 'Poll.numero_familias_habitan_casa_albergue', 'Poll.tipo_vivienda_predio', 'Poll.numero_familias_subsidio_vivienda_nueva', 'Poll.capacidad_vivienda_suficiente', 'Poll.numero_familias_subsidio_vivienda_compra', 'Poll.numero_familias_subsidio_vivienda_mejora', 'Poll.numero_familias_subsidio_vivienda_otro', 'Poll.numero_familias_con_sistema_autoconstruccion', 'Poll.numero_familias_con_sistema_credito', 'Poll.numero_familias_con_sistema_herencia', 'Poll.numero_familias_con_sistema_otro')));
            $this->set('visto_bueno', $this->data['Poll']['visto_bueno']);
        } else {
            if ($this->Poll->saveAll($this->data)) {
                $this->Session->setFlash('Encuesta Editada con éxito');
                $this->redirect(array('controller' => 'Polls', 'action' => 'conditions', $id));
            } else {
                $this->set('visto_bueno', $this->data['Poll']['visto_bueno']);
            }
        }
    }

    function housing($id = null) {
        $this->set('grupo', $this->Auth->user('group_id'));
        if (empty($this->data)) {
            $this->Poll->recursive = -1;
            $this->data = $this->Poll->find('first', array('conditions' => array('Poll.id' => $id), 'fields' => array('Poll.id', 'Poll.visto_bueno', 'Poll.area_vivienda_alcoba', 'Poll.area_vivienda_sala', 'Poll.area_vivienda_cocina', 'Poll.area_vivienda_comedor', 'Poll.area_vivienda_patio', 'Poll.area_vivienda_bano', 'Poll.area_vivienda_otro_cual', 'Poll.area_vivienda_otro_num', 'Poll.saneamiento_basico', 'Poll.servicio_agua', 'Poll.materiales_muro', 'Poll.materiales_cubierta', 'Poll.estado_pisos', 'Poll.tipo_alumbrado', 'Poll.tipo_combustible', 'Poll.tipo_cocina', 'Poll.saneamiento_basico_otro', 'Poll.servicio_agua_otro', 'Poll.materiales_muros_otro', 'Poll.materiales_cubierta_otro', 'Poll.estado_pisos_otro', 'Poll.tipo_alumbrado_otro', 'Poll.cocina_con_agua', 'area_vivienda_alcoba', 'Poll.area_vivienda_sala', 'Poll.area_vivienda_cocina', 'Poll.area_vivienda_comedor', 'Poll.area_vivienda_patio', 'Poll.area_vivienda_bano', 'Poll.area_vivienda_otro_cual', 'Poll.area_vivienda_otro_num', 'Poll.saneamiento_basico', 'Poll.servicio_agua', 'Poll.materiales_muro', 'Poll.materiales_cubierta', 'Poll.estado_pisos', 'Poll.tipo_alumbrado', 'Poll.tipo_combustible', 'Poll.tipo_cocina', 'Poll.saneamiento_basico_otro', 'Poll.servicio_agua_otro', 'Poll.materiales_muros_otro', 'Poll.materiales_cubierta_otro', 'Poll.estado_pisos_otro', 'Poll.tipo_alumbrado_otro', 'Poll.cocina_con_agua')));
            $this->set('visto_bueno', $this->data['Poll']['visto_bueno']);
        } else {
            if ($this->Poll->saveAll($this->data)) {
                $this->Session->setFlash('Encuesta Editada con éxito');
                $this->redirect(array('controller' => 'Polls', 'action' => 'housing', $id));
            } else {
                $this->set('visto_bueno', $this->data['Poll']['visto_bueno']);
            }
        }
    }

    function evaluation($id = null) {
        $this->set('grupo', $this->Auth->user('group_id'));
        if (empty($this->data)) {
            $this->Poll->recursive = -1;
            $this->data = $this->Poll->find('first', array('conditions' => array('Poll.id' => $id), 'fields' => array('Poll.id', 'Poll.visto_bueno', 'Poll.debilidades_grupo_beneficiarios', 'Poll.fortalezas_grupo_beneficiarios', 'Poll.amenazas_grupo_beneficiarios', 'Poll.oportunidades_grupo_beneficiarios')));
            $this->set('visto_bueno', $this->data['Poll']['visto_bueno']);
        } else {
            if ($this->Poll->saveAll($this->data)) {
                $this->Session->setFlash('Encuesta Editada con éxito');
                $this->redirect(array('controller' => 'Polls', 'action' => 'evaluation', $id));
            } else {
                //redirige acá cuando no puede guardar?? 
                $this->set('visto_bueno', $this->data['Poll']['visto_bueno']);
            }
        }
    }

    public function eservices($id = null) {
        $this->set('grupo', $this->Auth->user('group_id'));
        if (empty($this->data)) {
            $this->Poll->recursive = -1;
            $this->data = $this->Poll->find('first', array('conditions' => array('Poll.id' => $id), 'fields' => array('Poll.id', 'Poll.visto_bueno', 'Poll.hay_escuela', 'Poll.hay_colegio', 'Poll.escuela_capacidad_suficiente', 'Poll.colegio_capacidad_suficiente', 'Poll.escuela_cerca_predio', 'Poll.colegio_cerca_predio', 'Poll.distancia_escuela', 'Poll.distancia_colegio', 'Poll.riesgo_ninos_escuela', 'Poll.riesgo_ninos_colegio', 'Poll.riesgo_ninos_colegio_descripcion', 'Poll.riesgo_ninos_escuela_descripcion', 'Poll.hay_centro_salud', 'Poll.capacidad_suficiente_centro_salud', 'Poll.centro_salud_cerca_predio', 'Poll.distancia_a_centro_salud', 'Poll.riesgo_centro_salud', 'Poll.riesgo_centro_salud_descripcion', 'Poll.hay_entidades_financieras', 'Poll.es_usuario_credito', 'Poll.entidad_financiera_cerca_predio', 'Poll.distancia_entidad_financiera', 'Poll.dispocision_realizar_credito', 'Poll.razon_para_no_solicitar_credito')));
            $this->set('visto_bueno', $this->data['Poll']['visto_bueno']);
        } else {
            if ($this->Poll->saveAll($this->data)) {
                $this->Session->setFlash('Encuesta Editada con éxito');
                $this->redirect(array('controller' => 'Polls', 'action' => 'eservices', $id));
            } else {
                $this->set('visto_bueno', $this->data['Poll']['visto_bueno']);
            }
        }
    }

    public function ambiental($id = null) {
        $this->set('grupo', $this->Auth->user('group_id'));
        if (empty($this->data)) {
            $this->Poll->recursive = -1;
            $this->data = $this->Poll->find('first', array('conditions' => array('Poll.id' => $id), 'fields' => array('Poll.id', 'Poll.visto_bueno', 'Poll.zonas_proteccion_rios', 'Poll.manejo_proteccion_rios', 'Poll.limita_reserva_forestal', 'Poll.limita_sabana_comunal', 'Poll.limita_parque_natural', 'Poll.limita_playon_comunal', 'Poll.limita_paramo', 'Poll.limita_playa_fluvial', 'Poll.limita_humedal', 'Poll.limita_playa_maritima', 'Poll.limita_resguardo_indigena', 'Poll.limita_reserva_entidad_publica', 'Poll.limita_zona_turismo', 'Poll.limita_otro', 'Poll.limita_otro_descripcion', 'Poll.explota_recursos_no_renovables', 'Poll.usos_eot_pot', 'Poll.restricciones_eot_pot', 'Poll.conflicto_uso_suelo', 'Poll.conflicto_uso_suelo_descripcion', 'Poll.causas_origen_conflicto', 'Poll.concepto_biofisico_agrologico', 'Poll.calificacion_biofisico_agrlologico', 'Poll.concepto_social', 'Poll.calificacion_social', 'Poll.concepto_economico', 'Poll.calificacion_aconomico', 'Poll.concepto_ambiental', 'Poll.calificacion_ambiental', 'Poll.cities_id', 'Poll.departamento', 'Poll.calificacion_caracteristicas_biofisicas', 'Poll.calificacion_sociales', 'Poll.calificacion_economicos', 'Poll.calificacion_ambientales', 'Poll.vocacion_productiva_agricola', 'Poll.vocacion_productiva_pecuaria', 'Poll.vocacion_productiva_forestal', 'Poll.vocacion_productiva_acuicola', 'Poll.distancia_centro_comercializacion_km', 'Poll.distancia_centro_comercializacion_horas', 'Poll.area_otras_descripcion', 'Poll.predio_propenso_inundaciones', 'Poll.predio_propenso_derrumbes', 'Poll.predio_propenso_incendios', 'Poll.predio_propenso_invasiones', 'Poll.predio_propenso_erosion', 'Poll.predio_propenso_otro', 'Poll.predio_propenso_otro_descripcion', 'Poll.zonas_proteccion_bosques', 'Poll.manejo_proteccion_bosques', 'Poll.zonas_proteccion_procesos_erosion', 'Poll.manejo_proteccion_procesos_erosion', 'Poll.zonas_proteccion_tratamiento_residuos', 'Poll.manejo_proteccion_tratamiento_residuos', 'Poll.zonas_proteccion_aguas_residuales', 'Poll.manejo_proteccion_aguas_residuales', 'Poll.zonas_proteccion_sobrantes_agua', 'Poll.manejo_proteccion_sobrantes_agua', 'Poll.observaciones_predio_requiere_manejo_ambiental')));
            $this->set('visto_bueno', $this->data['Poll']['visto_bueno']);
        } else {
            if ($this->Poll->saveAll($this->data)) {
                $this->Session->setFlash('Encuesta Editada con éxito');
                $this->redirect(array('controller' => 'Polls', 'action' => 'ambiental', $id));
            } else {
                $this->set('visto_bueno', $this->data['Poll']['visto_bueno']);
            }
        }
    }

    public function calification($id = null) {
        $this->set('grupo', $this->Auth->user('group_id'));
        if (empty($this->data)) {
            $this->Poll->recursive = -1;
            $this->data = $this->Poll->find('first', array('conditions' => array('Poll.id' => $id), 'fields' => array('Poll.id', 'Poll.visto_bueno', 'Poll.calificacion_caracteristicas_biofisicas', 'Poll.concepto_biofisico_agrologico', 'Poll.calificacion_sociales', 'Poll.concepto_social', 'Poll.calificacion_economicos', 'Poll.concepto_economico', 'Poll.calificacion_ambientales', 'Poll.concepto_ambiental')));
            $this->set('visto_bueno', $this->data['Poll']['visto_bueno']);
        } else {
            if ($this->Poll->saveAll($this->data)) {
                $this->Session->setFlash('Encuesta Editada con éxito');
                $this->redirect(array('controller' => 'Polls', 'action' => 'calification', $id));
            } else {
                $this->set('visto_bueno', $this->data['Poll']['visto_bueno']);
            }
        }
    }

    public function estado_encuestas() {
        $this->layout = 'csv';
        ini_set('max_execution_time', 600); //increase max_execution_time to 10 min if data set is very large
        //create a file
        date_default_timezone_set("America/Bogota");
        $filename = "Estado_encuestas_" . date("Y.m.d") . ".csv";
        $csv_file = fopen('php://output', 'w');
        header('Content-type: application/csv');
        header('Content-Disposition: attachment; filename="' . $filename . '"');

        $sql = "SELECT DISTINCT a.id, a.codigo, c.username, d.verificacion_fase_uno, d.descripcion_verificacion_fase_uno, d.visto_bueno, d.descripcion_visto_bueno,
            d.calificacion_caracteristicas_biofisicas, d.concepto_biofisico_agrologico, d.calificacion_sociales, d.concepto_social, d.calificacion_economicos,
            d.concepto_economico, d.calificacion_ambientales, d.concepto_ambiental, d.descripcion_vias_internas, d.georeferenciacion, d.estado
FROM proyects a
JOIN user_proyects b ON b.proyect_id = a.id
JOIN users c ON b.user_id = c.id
LEFT JOIN polls d ON d.proyect_id = a.id
WHERE c.group_id = 4 AND a.codigo IN (
'MD1-AMA-002',
'C1-ANT-MED-026',
'C1-ANT-MED-034',
'C1-ANT-MED-036',
'C1-ANT-MED-086',
'C1-ANT-MED-089',
'C1-ANT-MED-090',
'C1-ANT-MED-100',
'C1-ANT-MED-139',
'C1-ANT-MED-166',
'C1-ANT-MED-180',
'C1-ANT-MED-376',
'C1-ANT-MED-389',
'C1-ANT-MED-432',
'C1-ANT-MED-579',
'C1-ANT-MED-622',
'C1-ANT-MED-656',
'C1-ANT-MED-675',
'C1-ANT-URB-005',
'C1-ANT-URB-041',
'C1-ANT-URB-119',
'D1-ANT-MED-083',
'D1-ANT-MED-298',
'D1-ANT-MED-349',
'D1-ANT-MED-442',
'D1-ANT-MED-500',
'D1-ANT-MED-679',
'D1-ANT-URB-019',
'D1-ANT-URB-028',
'D1-ANT-URB-031',
'D1-ANT-URB-077',
'D1-SAN-726',
'MD1-ANT-URB-049',
'MD1-ANT-URB-076',
'C1-ARA-004',
'C1-ARA-007',
'C1-ARA-009',
'C1-ARA-013',
'C1-ARA-016',
'C1-ARA-019',
'C1-ARA-023',
'C1-ARA-024',
'C1-ARA-030',
'C1-ARA-036',
'C1-ARA-038',
'C1-ARA-041',
'C1-ARA-042',
'C1-ARA-049',
'C1-ARA-103',
'C1-ARA-104',
'C1-ARA-105',
'C1-SAN-771',
'D1-ARA-051',
'D1-ARA-054',
'D1-ARA-055',
'D1-ARA-057',
'D1-ARA-060',
'D1-ARA-062',
'D1-ARA-063',
'D1-ARA-064',
'D1-ARA-065',
'D1-ARA-069',
'D1-ARA-070',
'D1-ARA-074',
'D1-ARA-078',
'D1-ARA-080',
'D1-ARA-081',
'D1-ARA-084',
'D1-ARA-085',
'D1-ARA-090',
'D1-ARA-091',
'D1-ARA-092',
'D1-ARA-098',
'D1-ARA-106',
'MD1-ARA-059',
'MD1-ARA-094',
'MD1-ARA-095',
'MD1-ARA-100',
'MD1-ARA-101',
'C1-BOL-016',
'C1-SUC-044',
'D1-BOL-068',
'D1-SUC-040',
'MD1-BOL-056',
'MD1-BOL-057',
'C1-BOY-042',
'C1-BOY-090',
'C1-BOY-141',
'C1-BOY-183',
'C1-BOY-202',
'C1-BOY-215',
'C1-BOY-226',
'C1-BOY-232',
'C1-BOY-240',
'C1-BOY-247',
'C1-BOY-268',
'C1-BOY-273',
'C1-BOY-295',
'D1-BOY-012',
'D1-BOY-051',
'D1-BOY-068',
'MD1-BOY-020',
'MD1-BOY-036',
'MD1-CUN-795',
'C1-ANT-MED-594',
'C1-CAL-125',
'C1-CAL-290',
'C1-CAL-314',
'D1-CAL-044',
'D1-CAL-063',
'D1-CAL-081',
'D1-CAL-124',
'D1-CAL-131',
'D1-CAL-151',
'D1-CAL-185',
'D1-CAL-202',
'D1-CAL-282',
'D1-CAL-303',
'MD1-CAL-055',
'C1-CAQ-006',
'C1-CAQ-017',
'C1-CAQ-024',
'C1-CAQ-098',
'C1-CAQ-102',
'C1-CAQ-114',
'C1-CAQ-121',
'C1-CAQ-129',
'C1-CAQ-144',
'C1-CAQ-182',
'C1-CAQ-201',
'C1-CAQ-204',
'C1-CAQ-207',
'C1-CAQ-232',
'C1-CAQ-250',
'C1-CAQ-260',
'C1-CAQ-265',
'C1-CAQ-287',
'C1-CAQ-290',
'C1-CAQ-313',
'C1-CAQ-314',
'C1-CAQ-328',
'C1-CAQ-337',
'C1-CAQ-370',
'C1-CAQ-385',
'C1-CAQ-388',
'C1-CAQ-414',
'D1-CAQ-042',
'D1-CAQ-082',
'D1-CAQ-087',
'D1-CAQ-095',
'D1-CAQ-115',
'D1-CAQ-181',
'D1-CAQ-183',
'D1-CAQ-214',
'D1-CAQ-274',
'D1-CAQ-296',
'D1-CAQ-311',
'D1-CAQ-316',
'D1-CAQ-329',
'D1-CAQ-341',
'D1-CAQ-342',
'D1-CAQ-368',
'D1-CAQ-378',
'D1-CAQ-389',
'D1-CAQ-391',
'D1-CAQ-411',
'D1-CAQ-415',
'MD1-CAQ-117',
'MD1-CAQ-141',
'MD1-CAQ-285',
'MD1-CAQ-390',
'C1-CAS-020',
'C1-CAS-037',
'C1-CAS-044',
'C1-CAU-048',
'C1-CAU-049',
'C1-CAU-057',
'C1-CAU-058',
'C1-CAU-065',
'C1-CAU-074',
'C1-CAU-079',
'C1-CAU-083',
'C1-CAU-088',
'C1-CAU-111',
'C1-CAU-114',
'C1-CAU-129',
'C1-CAU-138',
'C1-CAU-139',
'C1-CAU-143',
'C1-CAU-158',
'C1-CAU-168',
'C1-CAU-194',
'C1-CAU-210',
'C1-CAU-248',
'C1-CAU-251',
'C1-CAU-256',
'C1-CAU-261',
'C1-PUT-691',
'D1-CAU-024',
'D1-CAU-056',
'D1-CAU-068',
'D1-CAU-153',
'D1-CAU-175',
'D1-CAU-200',
'D1-CAU-229',
'D1-CAU-231',
'D1-CAU-235',
'D1-CAU-246',
'D1-CAU-268',
'D1-CAU-269',
'MD1-CAU-149',
'MD1-CAU-163',
'MD1-PUT-484',
'C1-CES-017',
'C1-CES-051',
'C1-CES-063',
'C1-CES-072',
'C1-CES-075',
'C1-CES-128',
'C1-CES-147',
'C1-CES-166',
'D1-CES-004',
'D1-CES-011',
'D1-CES-013',
'D1-CES-065',
'D1-CES-099',
'D1-SAN-701',
'MD1-CES-171',
'C1-CHO-016',
'D1-CHO-001',
'D1-CHO-005',
'D1-CHO-028',
'MD1-CHO-002',
'MD1-CHO-003',
'C1-COR-084',
'C1-COR-092',
'C1-COR-093',
'D1-COR-005',
'D1-COR-013',
'D1-COR-020',
'D1-COR-022',
'MD1-COR-025',
'C1-CUN-310',
'C1-CUN-385',
'C1-CUN-890',
'D1-CUN-100',
'D1-CUN-164',
'D1-CUN-180',
'D1-CUN-189',
'D1-CUN-338',
'D1-CUN-390',
'D1-CUN-411',
'D1-CUN-493',
'D1-CUN-550',
'D1-CUN-602',
'D1-CUN-640',
'D1-CUN-743',
'D1-CUN-886',
'MD1-CUN-050',
'MD1-CUN-092',
'MD1-CUN-175',
'MD1-CUN-278',
'MD1-CUN-468',
'MD1-CUN-560',
'MD1-CUN-576',
'MD1-CUN-612',
'MD1-CUN-663',
'MD1-CUN-706',
'MD1-CUN-763',
'MD1-CUN-768',
'D1-GUN-002',
'D1-GUN-003',
'C1-GUV-006',
'C1-GUV-055',
'D1-GUV-019',
'D1-GUV-034',
'D1-GUV-042',
'D1-GUV-049',
'D1-GUV-056',
'D1-GUV-060',
'D1-MET-031',
'MD1-GUV-066',
'MD1-GUV-067',
'MD1-GUV-068',
'MD1-GUV-069',
'C1-HUI-173',
'C1-HUI-195',
'C1-HUI-338',
'C1-HUI-352',
'C1-HUI-369',
'C1-HUI-379',
'C1-HUI-390',
'C1-HUI-395',
'C1-HUI-397',
'C1-HUI-428',
'C1-HUI-438',
'D1-CUN-677',
'D1-HUI-019',
'D1-HUI-050',
'D1-HUI-058',
'D1-HUI-066',
'D1-HUI-074',
'D1-HUI-076',
'D1-HUI-093',
'D1-HUI-094',
'D1-HUI-114',
'D1-HUI-156',
'MD1-HUI-037',
'MD1-HUI-040',
'MD1-HUI-046',
'MD1-HUI-143',
'MD1-HUI-426',
'C1-GUA-021',
'C1-GUA-063',
'D1-CES-001',
'D1-GUA-001',
'D1-GUA-003',
'D1-GUA-004',
'D1-GUA-007',
'D1-GUA-010',
'D1-GUA-036',
'D1-GUA-045',
'D1-GUA-050',
'D1-GUA-094',
'D1-GUA-106',
'D1-GUA-107',
'C1-MAG-044',
'C1-MAG-074',
'C1-MAG-149',
'D1-MAG-026',
'D1-MAG-102',
'MD1-MAG-150',
'MD1-MAG-193',
'C1-NAR-PAS-007',
'C1-NAR-PAS-051',
'C1-NAR-PAS-109',
'C1-NAR-PAS-1128',
'C1-NAR-PAS-1151',
'C1-NAR-PAS-1164',
'C1-NAR-PAS-129',
'C1-NAR-PAS-134',
'C1-NAR-PAS-157',
'C1-NAR-PAS-166',
'C1-NAR-PAS-245',
'C1-NAR-PAS-302',
'C1-NAR-PAS-315',
'C1-NAR-PAS-318',
'C1-NAR-PAS-415',
'C1-NAR-PAS-422',
'C1-NAR-PAS-426',
'C1-NAR-PAS-461',
'C1-NAR-PAS-611',
'C1-NAR-PAS-667',
'C1-NAR-PAS-691',
'C1-NAR-PAS-709',
'C1-NAR-PAS-827',
'C1-NAR-PAS-948',
'D1-NAR-PAS-1005',
'D1-NAR-PAS-1083',
'D1-NAR-PAS-126',
'D1-NAR-PAS-130',
'D1-NAR-PAS-212',
'D1-NAR-PAS-258',
'D1-NAR-PAS-498',
'D1-NAR-PAS-651',
'D1-NAR-PAS-686',
'D1-NAR-PAS-767',
'D1-NAR-PAS-778',
'D1-NAR-PAS-805',
'D1-NAR-PAS-815',
'D1-NAR-PAS-902',
'D1-NAR-TUM-006',
'D1-NAR-TUM-038',
'D1-NAR-TUM-042',
'D1-NAR-TUM-047',
'D1-NAR-TUM-050',
'D1-NAR-TUM-052',
'D1-NAR-TUM-055',
'MD1-NAR-PAS-002',
'MD1-NAR-PAS-009',
'MD1-NAR-PAS-104',
'MD1-NAR-PAS-1053',
'MD1-NAR-PAS-1098',
'MD1-NAR-PAS-1102',
'MD1-NAR-PAS-1134',
'MD1-NAR-PAS-117',
'MD1-NAR-PAS-141',
'MD1-NAR-PAS-176',
'MD1-NAR-PAS-196',
'MD1-NAR-PAS-203',
'MD1-NAR-PAS-236',
'MD1-NAR-PAS-256',
'MD1-NAR-PAS-279',
'MD1-NAR-PAS-284',
'MD1-NAR-PAS-294',
'MD1-NAR-PAS-312',
'MD1-NAR-PAS-404',
'MD1-NAR-PAS-613',
'MD1-NAR-PAS-674',
'MD1-NAR-PAS-719',
'MD1-NAR-PAS-820',
'MD1-NAR-PAS-857',
'MD1-NAR-PAS-862',
'MD1-NAR-PAS-921',
'MD1-NAR-PAS-955',
'MD1-NAR-TUM-001',
'MD1-NAR-TUM-003',
'MD1-NAR-TUM-004',
'MD1-NAR-TUM-007',
'MD1-NAR-TUM-010',
'MD1-NAR-TUM-012',
'MD1-NAR-TUM-013',
'MD1-NAR-TUM-049',
'C1-NOR-004',
'C1-NOR-006',
'C1-NOR-007',
'C1-NOR-009',
'C1-NOR-014',
'C1-NOR-016',
'C1-NOR-017',
'C1-NOR-019',
'C1-NOR-023',
'C1-NOR-027',
'C1-NOR-029',
'C1-NOR-030',
'C1-NOR-032',
'C1-NOR-035',
'C1-NOR-038',
'C1-NOR-053',
'C1-NOR-055',
'C1-NOR-066',
'D1-NOR-070',
'D1-NOR-071',
'D1-NOR-077',
'D1-NOR-078',
'D1-NOR-082',
'D1-NOR-088',
'D1-NOR-099',
'D1-SAN-306',
'C1-CAQ-199',
'C1-PUT-020',
'C1-PUT-030',
'C1-PUT-032',
'C1-PUT-055',
'C1-PUT-060',
'C1-PUT-087',
'C1-PUT-088',
'C1-PUT-110',
'C1-PUT-114',
'C1-PUT-133',
'C1-PUT-159',
'C1-PUT-181',
'C1-PUT-215',
'C1-PUT-246',
'C1-PUT-261',
'C1-PUT-273',
'C1-PUT-283',
'C1-PUT-284',
'C1-PUT-292',
'C1-PUT-298',
'C1-PUT-307',
'C1-PUT-365',
'C1-PUT-375',
'C1-PUT-378',
'C1-PUT-391',
'C1-PUT-393',
'C1-PUT-404',
'C1-PUT-412',
'C1-PUT-430',
'C1-PUT-442',
'C1-PUT-467',
'C1-PUT-473',
'C1-PUT-489',
'C1-PUT-504',
'C1-PUT-579',
'C1-PUT-582',
'C1-PUT-594',
'C1-PUT-598',
'C1-PUT-618',
'C1-PUT-659',
'C1-PUT-669',
'C1-PUT-688',
'D1-PUT-004',
'D1-PUT-013',
'D1-PUT-018',
'D1-PUT-019',
'D1-PUT-027',
'D1-PUT-033',
'D1-PUT-036',
'D1-PUT-041',
'D1-PUT-046',
'D1-PUT-080',
'D1-PUT-095',
'D1-PUT-101',
'D1-PUT-136',
'D1-PUT-139',
'D1-PUT-170',
'D1-PUT-175',
'D1-PUT-177',
'D1-PUT-183',
'D1-PUT-204',
'D1-PUT-222',
'D1-PUT-231',
'D1-PUT-241',
'D1-PUT-288',
'D1-PUT-299',
'D1-PUT-325',
'D1-PUT-346',
'D1-PUT-357',
'D1-PUT-367',
'D1-PUT-377',
'D1-PUT-397',
'D1-PUT-454',
'D1-PUT-471',
'D1-PUT-474',
'D1-PUT-533',
'D1-PUT-538',
'D1-PUT-586',
'D1-PUT-596',
'D1-PUT-597',
'D1-PUT-599',
'D1-PUT-603',
'D1-PUT-615',
'D1-PUT-640',
'D1-PUT-645',
'D1-PUT-651',
'D1-PUT-664',
'MD1-NAR-PAS-247',
'MD1-NAR-PAS-299',
'MD1-PUT-078',
'MD1-PUT-086',
'MD1-PUT-092',
'MD1-PUT-104',
'MD1-PUT-116',
'MD1-PUT-124',
'MD1-PUT-129',
'MD1-PUT-147',
'MD1-PUT-151',
'MD1-PUT-223',
'MD1-PUT-236',
'MD1-PUT-259',
'MD1-PUT-339',
'MD1-PUT-445',
'MD1-PUT-463',
'MD1-PUT-540',
'MD1-PUT-545',
'MD1-PUT-549',
'MD1-PUT-567',
'MD1-PUT-593',
'MD1-PUT-646',
'MD1-PUT-647',
'MD1-QUI-103',
'C1-RIS-071',
'C1-BOY-176',
'C1-SAN-051',
'C1-SAN-091',
'C1-SAN-108',
'C1-SAN-119',
'C1-SAN-166',
'C1-SAN-189',
'C1-SAN-219',
'C1-SAN-220',
'C1-SAN-291',
'C1-SAN-335',
'C1-SAN-343',
'C1-SAN-348',
'C1-SAN-415',
'C1-SAN-534',
'C1-SAN-561',
'C1-SAN-575',
'C1-SAN-604',
'C1-SAN-630',
'C1-SAN-670',
'C1-SAN-696',
'C1-SAN-703',
'C1-SAN-794',
'C1-SAN-805',
'D1-SAN-102',
'D1-SAN-140',
'D1-SAN-173',
'D1-SAN-206',
'D1-SAN-700',
'D1-SAN-748',
'D1-SAN-816',
'MD1-SAN-027',
'MD1-SAN-152',
'MD1-SAN-212',
'MD1-SAN-371',
'C1-SUC-022',
'C1-SUC-057',
'D1-SUC-056',
'MD1-SUC-011',
'MD1-SUC-024',
'MD1-SUC-067',
'C1-CUN-124',
'C1-CUN-291',
'C1-QUI-095',
'C1-TOL-014',
'C1-TOL-018',
'C1-TOL-022',
'C1-TOL-058',
'C1-TOL-078',
'C1-TOL-114',
'C1-TOL-116',
'C1-TOL-118',
'C1-TOL-127',
'C1-TOL-148',
'C1-TOL-201',
'C1-TOL-221',
'C1-TOL-244',
'C1-TOL-248',
'C1-TOL-321',
'C1-TOL-329',
'C1-TOL-342',
'C1-TOL-357',
'C1-TOL-450',
'C1-TOL-453',
'C1-TOL-491',
'C1-TOL-513',
'C1-TOL-516',
'C1-TOL-517',
'C1-TOL-528',
'C1-TOL-562',
'C1-TOL-563',
'C1-TOL-590',
'C1-TOL-637',
'C1-TOL-709',
'C1-TOL-723',
'C1-TOL-735',
'C1-TOL-743',
'C1-TOL-751',
'C1-TOL-756',
'C1-TOL-764',
'C1-TOL-766',
'C1-TOL-798',
'C1-TOL-818',
'C1-TOL-822',
'D1-CUN-027',
'D1-CUN-072',
'D1-CUN-139',
'D1-TOL-003',
'D1-TOL-231',
'D1-TOL-259',
'D1-TOL-260',
'D1-TOL-309',
'D1-TOL-317',
'D1-TOL-320',
'D1-TOL-335',
'D1-TOL-460',
'D1-TOL-478',
'D1-TOL-482',
'D1-TOL-503',
'D1-TOL-520',
'D1-TOL-570',
'D1-TOL-614',
'D1-TOL-640',
'D1-TOL-657',
'D1-TOL-659',
'D1-TOL-662',
'D1-TOL-693',
'D1-TOL-799',
'D1-TOL-806',
'D1-TOL-811',
'MD1-CUN-232',
'MD1-TOL-016',
'MD1-TOL-027',
'MD1-TOL-032',
'MD1-TOL-211',
'MD1-TOL-341',
'MD1-TOL-347',
'MD1-TOL-472',
'MD1-TOL-601',
'MD1-TOL-790',
'C1-VIC-001',
'C1-VIC-054',
'C1-VIC-070',
'C1-VIC-089',
'D1-VIC-024',
'D1-VIC-051',
'MD1-VIC-021',
'MD1-VIC-023',
'MD1-VIC-061',
'MD1-VIC-064',
'MD1-VIC-069',
'MD1-VIC-083',
'MD1-VIC-098',
'MD1-VIC-102',
'C1-ANT-MED-254',
'C1-ANT-MED-491',
'C1-ANT-MED-519',
'C1-ARA-026',
'C1-ARA-031',
'D1-ARA-066',
'MD1-ARA-102',
'C1-BOL-048',
'D1-BOL-080',
'C1-BOY-101',
'C1-BOY-105',
'C1-CAL-095',
'C1-CAL-142',
'C1-CAL-182',
'C1-CAL-184',
'D1-CAL-029',
'D1-CAL-031',
'D1-CAL-100',
'D1-CAL-103',
'D1-CAL-120',
'D1-CAL-338',
'D1-CAL-368',
'C1-CAQ-002',
'C1-CAQ-013',
'C1-CAQ-040',
'C1-CAQ-053',
'C1-CAQ-056',
'C1-CAQ-059',
'C1-CAQ-066',
'C1-CAQ-092',
'C1-CAQ-093',
'C1-CAQ-125',
'C1-CAQ-126',
'C1-CAQ-138',
'C1-CAQ-177',
'C1-CAQ-226',
'C1-CAQ-230',
'C1-CAQ-258',
'C1-CAQ-277',
'C1-CAQ-301',
'C1-CAQ-302',
'C1-CAQ-304',
'C1-CAQ-332',
'C1-CAQ-343',
'C1-CAQ-357',
'C1-CAQ-364',
'C1-CAQ-407',
'C1-CAQ-412',
'D1-CAQ-005',
'D1-CAQ-051',
'D1-CAQ-076',
'D1-CAQ-099',
'D1-CAQ-154',
'D1-CAQ-156',
'D1-CAQ-158',
'D1-CAQ-163',
'D1-CAQ-190',
'D1-CAQ-192',
'D1-CAQ-218',
'D1-CAQ-239',
'D1-CAQ-262',
'D1-CAQ-269',
'D1-CAQ-280',
'D1-CAQ-295',
'D1-CAQ-297',
'D1-CAQ-300',
'D1-CAQ-315',
'D1-CAQ-319',
'D1-CAQ-350',
'D1-CAQ-355',
'D1-CAQ-356',
'D1-CAQ-392',
'D1-CAQ-404',
'MD1-CAQ-012',
'MD1-CAQ-018',
'MD1-CAQ-036',
'MD1-CAQ-080',
'MD1-CAQ-118',
'MD1-CAQ-147',
'MD1-CAQ-240',
'MD1-CAQ-281',
'MD1-CAQ-283',
'C1-CAU-104',
'C1-CAU-108',
'C1-CAU-121',
'C1-CAU-184',
'D1-CAU-064',
'D1-CAU-072',
'D1-CAU-073',
'D1-CAU-125',
'D1-CAU-176',
'D1-CAU-213',
'D1-CAU-262',
'C1-CES-038',
'C1-CES-071',
'C1-CES-161',
'D1-CES-009',
'D1-CES-089',
'D1-MAG-111',
'C1-CHO-010',
'MD1-CHO-007',
'MD1-CHO-013',
'C1-COR-014',
'C1-COR-038',
'D1-COR-050',
'D1-COR-055',
'D1-COR-060',
'D1-COR-063',
'MD1-COR-023',
'MD1-COR-034',
'C1-CUN-502',
'D1-CUN-239',
'D1-CUN-306',
'D1-CUN-623',
'MD1-CUN-269',
'D1-GUV-012',
'D1-GUV-028',
'D1-GUV-047',
'MD1-GUV-026',
'C1-HUI-189',
'C1-HUI-191',
'C1-HUI-203',
'C1-HUI-248',
'C1-HUI-284',
'C1-HUI-287',
'C1-HUI-341',
'C1-HUI-346',
'C1-HUI-359',
'C1-HUI-383',
'C1-HUI-416',
'D1-HUI-018',
'D1-HUI-026',
'D1-HUI-057',
'D1-HUI-065',
'D1-HUI-126',
'D1-HUI-130',
'D1-HUI-411',
'MD1-HUI-055',
'D1-GUA-032',
'D1-GUA-049',
'C1-MAG-096',
'MD1-ATL-054',
'C1-NAR-PAS-012',
'C1-NAR-PAS-097',
'C1-NAR-PAS-1012',
'C1-NAR-PAS-1088',
'C1-NAR-PAS-1117',
'C1-NAR-PAS-1150',
'C1-NAR-PAS-513',
'C1-NAR-PAS-535',
'C1-NAR-PAS-644',
'C1-NAR-PAS-963',
'C1-NAR-PAS-994',
'D1-NAR-PAS-1022',
'D1-NAR-PAS-1148',
'D1-NAR-PAS-158',
'D1-NAR-PAS-368',
'D1-NAR-PAS-413',
'D1-NAR-PAS-441',
'D1-NAR-PAS-482',
'D1-NAR-PAS-486',
'D1-NAR-PAS-527',
'D1-NAR-PAS-550',
'D1-NAR-PAS-588',
'D1-NAR-PAS-593',
'D1-NAR-PAS-661',
'D1-NAR-PAS-678',
'D1-NAR-PAS-680',
'D1-NAR-PAS-744',
'D1-NAR-PAS-846',
'D1-NAR-PAS-892',
'D1-NAR-TUM-035',
'D1-NAR-TUM-039',
'D1-NAR-TUM-043',
'D1-PUT-120',
'D1-PUT-562',
'MD1-CUN-384',
'MD1-NAR-PAS-011',
'MD1-NAR-PAS-046',
'MD1-NAR-PAS-091',
'MD1-NAR-PAS-1036',
'MD1-NAR-PAS-1060',
'MD1-NAR-PAS-1065',
'MD1-NAR-PAS-1090',
'MD1-NAR-PAS-1152',
'MD1-NAR-PAS-128',
'MD1-NAR-PAS-136',
'MD1-NAR-PAS-138',
'MD1-NAR-PAS-272',
'MD1-NAR-PAS-283',
'MD1-NAR-PAS-285',
'MD1-NAR-PAS-323',
'MD1-NAR-PAS-331',
'MD1-NAR-PAS-365',
'MD1-NAR-PAS-397',
'MD1-NAR-PAS-416',
'MD1-NAR-PAS-743',
'MD1-NAR-PAS-809',
'MD1-NAR-PAS-840',
'MD1-NAR-PAS-865',
'MD1-NAR-PAS-866',
'MD1-NAR-TUM-009',
'C1-NOR-005',
'C1-NOR-010',
'C1-NOR-022',
'C1-NOR-063',
'C1-NOR-068',
'D1-NOR-083',
'D1-NOR-086',
'C1-PUT-026',
'C1-PUT-122',
'C1-PUT-156',
'C1-PUT-176',
'C1-PUT-198',
'C1-PUT-255',
'C1-PUT-329',
'C1-PUT-413',
'C1-PUT-420',
'C1-PUT-449',
'C1-PUT-512',
'C1-PUT-589',
'C1-PUT-606',
'D1-CAQ-196',
'D1-PUT-051',
'D1-PUT-094',
'D1-PUT-132',
'D1-PUT-134',
'D1-PUT-197',
'D1-PUT-203',
'D1-PUT-264',
'D1-PUT-280',
'D1-PUT-286',
'D1-PUT-315',
'D1-PUT-371',
'D1-PUT-400',
'D1-PUT-417',
'D1-PUT-422',
'D1-PUT-457',
'D1-PUT-476',
'D1-PUT-495',
'D1-PUT-528',
'D1-PUT-592',
'D1-PUT-607',
'D1-PUT-612',
'D1-PUT-639',
'D1-PUT-653',
'D1-PUT-654',
'D1-PUT-665',
'D1-PUT-679',
'D1-PUT-680',
'MD1-PUT-021',
'MD1-PUT-050',
'MD1-PUT-082',
'MD1-PUT-162',
'MD1-PUT-169',
'MD1-PUT-221',
'MD1-PUT-266',
'MD1-PUT-294',
'MD1-PUT-312',
'MD1-PUT-352',
'MD1-PUT-428',
'MD1-PUT-458',
'MD1-PUT-492',
'MD1-PUT-523',
'MD1-PUT-550',
'MD1-PUT-649',
'MD1-PUT-658',
'MD1-PUT-671',
'MD1-PUT-687',
'C1-RIS-034',
'D1-RIS-005',
'C1-SAN-012',
'C1-SAN-078',
'C1-SAN-079',
'C1-SAN-097',
'C1-SAN-103',
'C1-SAN-132',
'C1-SAN-134',
'C1-SAN-146',
'C1-SAN-198',
'C1-SAN-242',
'C1-SAN-243',
'C1-SAN-251',
'C1-SAN-260',
'C1-SAN-317',
'C1-SAN-332',
'C1-SAN-338',
'C1-SAN-341',
'C1-SAN-448',
'C1-SAN-553',
'C1-SAN-562',
'C1-SAN-688',
'C1-SAN-750',
'C1-SAN-762',
'C1-SAN-793',
'D1-SAN-188',
'D1-SAN-223',
'D1-SAN-452',
'D1-SAN-817',
'MD1-SAN-010',
'MD1-SAN-038',
'MD1-SAN-057',
'MD1-SAN-094',
'MD1-SAN-530',
'MD1-SAN-747',
'C1-SUC-019',
'D1-SUC-077',
'C1-TOL-021',
'C1-TOL-139',
'C1-TOL-208',
'C1-TOL-290',
'C1-TOL-369',
'C1-TOL-384',
'C1-TOL-399',
'C1-TOL-457',
'C1-TOL-750',
'C1-TOL-796',
'D1-CUN-074',
'D1-CUN-211',
'D1-CUN-328',
'D1-TOL-108',
'D1-TOL-122',
'D1-TOL-178',
'D1-TOL-522',
'D1-TOL-627',
'D1-TOL-711',
'MD1-TOL-264',
'MD1-TOL-649',
'MD1-TOL-684',
'D1-ANT-MED-072',
'D1-ANT-MED-231',
'D1-CAQ-286',
'MD1-CAQ-399',
'C1-CUN-229',
'C1-MAG-039',
'C1-MAG-147',
'C1-SAN-181',
'C1-PUT-643',
'D1-PUT-045',
'D1-PUT-609',
'MD1-PUT-447',
'C1-VIC-027',
'MD1-VIC-078')AND c.username NOT IN ('ESTASUR1','ESTASUR2','CREAR2','CREAR3','fbejarano2') ORDER BY c.username ASC";

        $results = $this->Poll->query($sql);

        // The column headings of your .csv file
        $header_row = array("Código", "Epsagro", "verificación fase uno", "descripción verificación fase uno", "visto bueno", "descripción visto bueno", "calificación características biofísicas", "concepto biofísico agrológico", "calificación sociales", "concepto social", "calificación económicos", "concepto económico", "calificación ambientales", "concepto ambiental", "descripción vías internas", "georeferenciación", "Publicación");

        $newRow = array();

        foreach ($header_row as $a) {
            $newRow[] = iconv('UTF-8', 'Windows-1252', $a);
        }

        fputcsv($csv_file, $newRow, ';', '"');

        $publicacion = "";

        // Each iteration of this while loop will be a row in your .csv file where each field corresponds to the heading of the column
        foreach ($results as $result) {
            // Array indexes correspond to the field names in your db table(s)
            if ($result['d']['estado'] == 1) {
                $publicacion = "Si";
            } else {
                $publicacion = "No";
            }
            $row = array(
                $result['a']['codigo'],
                $result['c']['username'],
                $result['d']['verificacion_fase_uno'],
                $result['d']['descripcion_verificacion_fase_uno'],
                $result['d']['visto_bueno'],
                $result['d']['descripcion_visto_bueno'],
                $result['d']['calificacion_caracteristicas_biofisicas'],
                $result['d']['concepto_biofisico_agrologico'],
                $result['d']['calificacion_sociales'],
                $result['d']['concepto_social'],
                $result['d']['calificacion_economicos'],
                $result['d']['concepto_economico'],
                $result['d']['calificacion_ambientales'],
                $result['d']['concepto_ambiental'],
                $result['d']['descripcion_vias_internas'],
                $result['d']['georeferenciacion'],
                $publicacion
            );

            $newRow = array();

            foreach ($row as $a) {
                $newRow[] = iconv('UTF-8', 'Windows-1252', $a);
            }

            fputcsv($csv_file, $newRow, ';', '"');
        }

        fclose($csv_file);
    }

    public function estado_encuestas_comite_reclamaciones($tipo) {
        App::Import('model', 'Property');
        App::Import('model', 'City');
        App::Import('model', 'Departament');

        $this->layout = 'csv';
        ini_set('max_execution_time', 600); //increase max_execution_time to 10 min if data set is very large
        date_default_timezone_set("America/Bogota");
        $filename = "Estado_Encuestas_Comite_Reclamaciones_" . date("Y.m.d") . ".csv";
        $csv_file = fopen('php://output', 'w');
        header('Content-type: application/csv');
        header('Content-Disposition: attachment; filename="' . $filename . '"');

        if ($tipo == 1) {
            $sql = "SELECT DISTINCT a.id, a.codigo, c.username, d.verificacion_fase_uno, d.descripcion_verificacion_fase_uno, d.visto_bueno, d.descripcion_visto_bueno,
            d.calificacion_caracteristicas_biofisicas, d.concepto_biofisico_agrologico, d.calificacion_sociales, d.concepto_social, d.calificacion_economicos,
            d.concepto_economico, d.calificacion_ambientales, d.concepto_ambiental, d.georeferenciacion, d.estado
            FROM proyects a
            JOIN user_proyects b ON b.proyect_id = a.id
            JOIN users c ON b.user_id = c.id
            LEFT JOIN polls d ON d.proyect_id = a.id
            WHERE c.group_id = 4 AND a.comite_reclamaciones = 1 AND c.username NOT IN ('ESTASUR1','ESTASUR2','CREAR2','CREAR3','fbejarano2') ORDER BY c.username ASC";
        } else if ($tipo == 2) {
            $sql = "SELECT DISTINCT a.id, a.codigo, c.username, d.verificacion_fase_uno, d.descripcion_verificacion_fase_uno, d.visto_bueno, d.descripcion_visto_bueno,
            d.calificacion_caracteristicas_biofisicas, d.concepto_biofisico_agrologico, d.calificacion_sociales, d.concepto_social, d.calificacion_economicos,
            d.concepto_economico, d.calificacion_ambientales, d.concepto_ambiental, d.georeferenciacion, d.estado
            FROM proyects a
            JOIN user_proyects b ON b.proyect_id = a.id
            JOIN users c ON b.user_id = c.id
            LEFT JOIN polls d ON d.proyect_id = a.id
            WHERE c.group_id = 4 AND a.comite_reclamaciones2 = 1 AND c.username NOT IN ('ESTASUR1','ESTASUR2','CREAR2','CREAR3','fbejarano2') ORDER BY c.username ASC";
        } else if ($tipo == 3) {
            $sql = "SELECT DISTINCT a.id, a.codigo, c.username, d.verificacion_fase_uno, d.descripcion_verificacion_fase_uno, d.visto_bueno, d.descripcion_visto_bueno,
            d.calificacion_caracteristicas_biofisicas, d.concepto_biofisico_agrologico, d.calificacion_sociales, d.concepto_social, d.calificacion_economicos,
            d.concepto_economico, d.calificacion_ambientales, d.concepto_ambiental, d.georeferenciacion, d.estado
            FROM proyects a
            JOIN user_proyects b ON b.proyect_id = a.id
            JOIN users c ON b.user_id = c.id
            LEFT JOIN polls d ON d.proyect_id = a.id
            WHERE c.group_id = 4 AND (a.comite_reclamaciones2 = 1 OR a.comite_reclamaciones = 1 OR a.comite_reclamaciones = 2) AND c.username NOT IN ('ESTASUR1','ESTASUR2','CREAR2','CREAR3','fbejarano2') ORDER BY c.username ASC";
            //Proyectos agregados por JAVIER NEVA EL 22/01/13 correo electronico.
            //Proyectos agregados por JAVIER NEVA EL 09/04/13 correo electronico.
        }


        $results = $this->Poll->query($sql);

        // The column headings of your .csv file
        $header_row = array("Código", "Departamento ejecución", "Municipio ejecución", "Epsagro", "Ratificación Concepto Fase I", "Justificación Ratificación Concepto Fase I", "Aprobación Concepto", "Justificación Aprobación Concepto", "Calificación características biofísicas", "Concepto Biofísico Agrológico", "Calificación Social", "Concepto Social", "Calificación Económico", "Concepto Económico", "Calificación Ambientales", "Concepto Ambiental", "Georeferenciación", "Concepto integral", "Responsable del concepto Pendiente");

        $newRow = array();

        foreach ($header_row as $a) {
            $newRow[] = iconv('UTF-8', 'Windows-1252', $a);
        }

        fputcsv($csv_file, $newRow, ';', '"');

        foreach ($results as $result) {

            $responsable = '';
            $conceptoIntegral = '';

            $property = new Property();
            $city = new City();
            $departament = new Departament();
            //busco la primera propiedad

            $city_id = $property->field('Property.city_id', array('Property.proyect_id' => $result['a']['id']));
            $ciudad = $city->field('City.name', array('City.id' => $city_id));

            $departament_id = $city->field('City.departament_id', array('City.id' => $city_id));
            $departamento = $departament->field('Departament.name', array('Departament.id' => $departament_id));

            if ($result['d']['calificacion_caracteristicas_biofisicas'] == null or $result['d']['calificacion_sociales'] == null
                    or $result['d']['calificacion_economicos'] == null or $result['d']['calificacion_ambientales'] == null or
                    $result['d']['calificacion_caracteristicas_biofisicas'] == '' or $result['d']['calificacion_sociales'] == ''
                    or $result['d']['calificacion_economicos'] == '' or $result['d']['calificacion_ambientales'] == ''
            ) {
                $conceptoIntegral = 'PENDIENTE';
                $responsable = "EPSAGRO " . $result['c']['username'];
            } else if ($result['d']['verificacion_fase_uno'] == null or $result['d']['visto_bueno'] == null or
                    $result['d']['verificacion_fase_uno'] == 'Sin registro' or $result['d']['visto_bueno'] == 'Sin registro') {
                $conceptoIntegral = 'PENDIENTE';
                $responsable = "Territorial " . $departamento;
            } else if ($result['d']['calificacion_caracteristicas_biofisicas'] == 'NO CUMPLE' or $result['d']['calificacion_sociales'] == 'NO CUMPLE'
                    or $result['d']['calificacion_economicos'] == 'NO CUMPLE' or $result['d']['calificacion_ambientales'] == 'NO CUMPLE' or
                    $result['d']['verificacion_fase_uno'] == 'No' or $result['d']['visto_bueno'] == 'Sin registro'
            ) {
                $conceptoIntegral = 'NO VIABLE';
            }

            if ($result['d']['calificacion_caracteristicas_biofisicas'] == 'CUMPLE' and $result['d']['calificacion_sociales'] == 'CUMPLE'
                    and $result['d']['calificacion_economicos'] == 'CUMPLE' and $result['d']['calificacion_ambientales'] == 'CUMPLE' and
                    $result['d']['verificacion_fase_uno'] == 'Si' and $result['d']['visto_bueno'] == 'Si') {
                $conceptoIntegral = 'VIABLE';
            }
            $row = array(
                $result['a']['codigo'],
                $departamento,
                $ciudad,
                $result['c']['username'],
                $result['d']['verificacion_fase_uno'],
                $result['d']['descripcion_verificacion_fase_uno'],
                $result['d']['visto_bueno'],
                $result['d']['descripcion_visto_bueno'],
                $result['d']['calificacion_caracteristicas_biofisicas'],
                $result['d']['concepto_biofisico_agrologico'],
                $result['d']['calificacion_sociales'],
                $result['d']['concepto_social'],
                $result['d']['calificacion_economicos'],
                $result['d']['concepto_economico'],
                $result['d']['calificacion_ambientales'],
                $result['d']['concepto_ambiental'],
                $result['d']['georeferenciacion'],
                $conceptoIntegral,
                $responsable
            );

            $newRow = array();

            foreach ($row as $a) {
                $newRow[] = iconv('UTF-8', 'Windows-1252', $a);
            }

            fputcsv($csv_file, $newRow, ';', '"');
        }

        fclose($csv_file);
    }

    public function estado_encuestas2() {
        $this->layout = 'csv';
        ini_set('max_execution_time', 600); //increase max_execution_time to 10 min if data set is very large
        //create a file
        $filename = "Estado_encuestas_2_" . date("Y.m.d") . ".csv";
        $csv_file = fopen('php://output', 'w');
        header('Content-type: application/csv');
        header('Content-Disposition: attachment; filename="' . $filename . '"');

        $sql = "SELECT DISTINCT a.id, a.codigo, c.username, d.verificacion_fase_uno, d.descripcion_verificacion_fase_uno, d.visto_bueno, d.descripcion_visto_bueno,
            d.calificacion_caracteristicas_biofisicas, d.concepto_biofisico_agrologico, d.calificacion_sociales, d.concepto_social, d.calificacion_economicos,
            d.concepto_economico, d.calificacion_ambientales, d.concepto_ambiental, d.descripcion_vias_internas, d.georeferenciacion, d.estado
FROM proyects a
JOIN user_proyects b ON b.proyect_id = a.id
JOIN users c ON b.user_id = c.id
LEFT JOIN polls d ON d.proyect_id = a.id
WHERE c.group_id = 4 AND a.codigo IN (
'C1-MAG-064',
'C1-HUI-200',
'C1-ATL-050',
'C1-PUT-308',
'C1-NAR-PAS-630',
'C1-NAR-PAS-972',
'C1-PUT-270',
'C1-HUI-301',
'C1-HUI-360',
'C1-CAL-150',
'C1-HUI-304',
'C1-NAR-PAS-640',
'C1-BOY-253',
'C1-CUN-301',
'C1-MAG-140',
'C1-PUT-010',
'C1-PUT-318',
'C1-PUT-684',
'C1-NAR-PAS-058',
'C1-NAR-PAS-1033',
'C1-NAR-PAS-1078',
'C1-NAR-PAS-353',
'C1-NAR-PAS-458',
'C1-NAR-PAS-538',
'C1-NAR-PAS-797',
'C1-SAN-766',
'C1-SAN-769',
'C1-NAR-PAS-192',
'C1-SAN-671',
'C1-SAN-795',
'C1-HUI-192',
'C1-HUI-281',
'C1-ANT-URB-055',
'C1-COR-049',
'C1-SAN-095',
'C1-NAR-PAS-909',
'C1-SAN-284',
'C1-NAR-PAS-049',
'C1-NAR-PAS-076',
'C1-NAR-PAS-103',
'C1-NAR-PAS-371',
'C1-NAR-PAS-558',
'C1-NAR-PAS-740',
'C1-NAR-PAS-754',
'C1-NAR-PAS-839',
'C1-TOL-159',
'C1-CAQ-321',
'C1-COR-073',
'C1-COR-043',
'C1-NAR-PAS-421',
'C1-NAR-PAS-974',
'C1-NAR-PAS-005',
'C1-NAR-PAS-1026',
'C1-NAR-PAS-1069',
'C1-NAR-PAS-1136',
'C1-NAR-PAS-151',
'C1-NAR-PAS-199',
'C1-NAR-PAS-205',
'C1-NAR-PAS-223',
'C1-NAR-PAS-246',
'C1-NAR-PAS-291',
'C1-NAR-PAS-310',
'C1-NAR-PAS-378',
'C1-NAR-PAS-435',
'C1-NAR-PAS-465',
'C1-NAR-PAS-484',
'C1-NAR-PAS-499',
'C1-NAR-PAS-524',
'C1-NAR-PAS-586',
'C1-NAR-PAS-612',
'C1-NAR-PAS-654',
'C1-NAR-PAS-662',
'C1-NAR-PAS-817',
'C1-NAR-PAS-818',
'C1-NAR-PAS-821',
'C1-NAR-PAS-830',
'C1-NAR-PAS-842',
'C1-NAR-PAS-880',
'C1-NAR-PAS-898',
'C1-NAR-PAS-899',
'C1-NAR-PAS-907',
'C1-NAR-PAS-913',
'C1-NAR-PAS-917',
'C1-NAR-PAS-939',
'C1-NAR-PAS-970',
'C1-NAR-PAS-978',
'C1-VIC-002',
'C1-VIC-008',
'C1-VIC-014',
'C1-VIC-017',
'C1-VIC-032',
'C1-VIC-036',
'C1-VIC-042',
'C1-VIC-057',
'C1-VIC-060',
'C1-VIC-077',
'C1-VIC-080',
'C1-VIC-097',
'C1-COR-024',
'C1-SAN-308',
'C1-CES-070',
'C1-ARA-002',
'C1-HUI-164',
'C1-SAN-733',
'C1-SAN-171',
'C1-ARA-005',
'C1-NOR-008',
'C1-TOL-801',
'C1-PUT-118',
'C1-PUT-229',
'C1-PUT-238',
'C1-PUT-438',
'C1-ANT-URB-111',
'C1-PUT-031',
'C1-PUT-149',
'C1-HUI-052',
'C1-HUI-258',
'C1-HUI-403',
'C1-ANT-MED-428',
'C1-ANT-MED-743',
'C1-ANT-MED-269',
'C1-BOY-286',
'C1-SUC-082',
'C1-SAN-196',
'C1-SAN-337',
'C1-CUN-076',
'C1-SAN-702',
'C1-NAR-PAS-106',
'C1-CUN-265',
'C1-NAR-PAS-220',
'C1-CUN-876',
'C1-CAU-198',
'C1-MAG-145',
'C1-ANT-MED-296',
'C1-SAN-258',
'C1-PUT-011',
'C1-NAR-PAS-244',
'C1-SAN-342',
'C1-BOY-233',
'C1-SAN-319',
'C1-SAN-340',
'C1-SAN-390',
'C1-CAQ-185',
'C1-CAQ-200',
'C1-CAQ-358',
'C1-CUN-520',
'C1-CAU-099',
'C1-CAU-245',
'C1-NAR-PAS-1104',
'C1-SAN-263',
'C1-BOY-029',
'C1-NAR-PAS-338',
'C1-TOL-826',
'C1-NAR-PAS-783',
'C1-BOY-086',
'C1-HUI-270',
'C1-SAN-216',
'C1-MAG-146',
'C1-SAN-233',
'C1-SAN-656',
'C1-SAN-262',
'C1-CAU-181',
'C1-BOY-169',
'C1-ANT-MED-413',
'C1-ANT-MED-615',
'C1-BOY-116',
'C1-SAN-755',
'C1-SAN-761',
'C1-CAQ-229',
'C1-NAR-PAS-852',
'C1-CUN-853',
'C1-CUN-224',
'C1-CUN-115',
'C1-BOY-185',
'C1-NAR-PAS-003',
'C1-NAR-PAS-908',
'C1-NAR-PAS-918',
'C1-NAR-PAS-928',
'C1-MAG-042',
'C1-PUT-508',
'C1-SAN-156',
'C1-BOY-028',
'C1-SAN-005',
'C1-SAN-082',
'C1-SAN-105',
'C1-SAN-618',
'C1-SAN-624',
'C1-SAN-649',
'C1-SAN-687',
'C1-SAN-275',
'C1-BOY-208',
'C1-CUN-637',
'C1-SAN-689',
'C1-BOY-075',
'C1-CUN-454',
'C1-NAR-PAS-602',
'C1-SAN-070',
'C1-NAR-PAS-867',
'C1-BOY-053',
'C1-NAR-PAS-1058',
'C1-NAR-PAS-526',
'C1-NAR-PAS-1023',
'C1-CUN-357',
'C1-SAN-165',
'C1-MAG-070',
'C1-BOY-182',
'C1-CAU-172',
'C1-CAU-195',
'C1-CUN-288',
'C1-CAL-317',
'C1-MAG-109',
'C1-NAR-PAS-1075',
'C1-ANT-MED-697',
'C1-NAR-PAS-1057',
'C1-NAR-PAS-155',
'C1-NAR-PAS-491',
'C1-BOY-035',
'C1-NAR-PAS-1056',
'C1-NAR-PAS-1071',
'C1-NAR-PAS-268',
'C1-NOR-033',
'C1-CUN-121',
'C1-SAN-192',
'C1-BOY-150',
'C1-BOY-254',
'C1-BOY-255',
'C1-HUI-354',
'C1-SAN-289',
'C1-SAN-339',
'C1-SAN-357',
'C1-SAN-362',
'C1-SAN-500',
'C1-SAN-504',
'C1-SAN-727',
'C1-BOY-062',
'C1-SAN-602',
'C1-SAN-622',
'C1-SAN-789',
'C1-SAN-501',
'C1-TOL-187',
'C1-TOL-578',
'C1-TOL-787',
'C1-NAR-PAS-085',
'C1-NAR-PAS-549',
'C1-NAR-PAS-739',
'C1-NAR-PAS-938',
'C1-TOL-821',
'C1-CUN-429',
'C1-CUN-447',
'C1-CUN-543',
'C1-CUN-639',
'C1-CAS-040',
'C1-CUN-870',
'C1-CUN-854',
'C1-SAN-421',
'C1-NAR-PAS-217',
'C1-CAL-088',
'C1-ANT-MED-419',
'C1-NAR-PAS-1123',
'C1-NAR-PAS-316',
'C1-BOY-283',
'C1-CAQ-050',
'C1-NAR-PAS-038',
'C1-NAR-PAS-064',
'C1-NAR-PAS-073',
'C1-NAR-PAS-083',
'C1-NAR-PAS-084',
'C1-NAR-PAS-1015',
'C1-NAR-PAS-1118',
'C1-NAR-PAS-1120',
'C1-NAR-PAS-1139',
'C1-NAR-PAS-1146',
'C1-NAR-PAS-191',
'C1-NAR-PAS-194',
'C1-NAR-PAS-232',
'C1-NAR-PAS-265',
'C1-NAR-PAS-292',
'C1-NAR-PAS-309',
'C1-NAR-PAS-387',
'C1-NAR-PAS-393',
'C1-NAR-PAS-492',
'C1-NAR-PAS-595',
'C1-NAR-PAS-676',
'C1-NAR-PAS-696',
'C1-NAR-PAS-770',
'C1-NAR-PAS-777',
'C1-NAR-PAS-785',
'C1-NAR-PAS-789',
'C1-NAR-PAS-824',
'C1-NAR-PAS-906',
'C1-NAR-PAS-971',
'D1-NAR-PAS-070',
'C1-NAR-PAS-248',
'C1-NAR-PAS-124',
'C1-NAR-PAS-1006',
'C1-NAR-PAS-123',
'C1-BOY-200',
'C1-BOY-225',
'C1-BOY-146',
'C1-BOY-148',
'C1-BOY-236',
'C1-SAN-383',
'C1-NAR-PAS-237',
'C1-BOY-264',
'C1-SAN-217',
'C1-NAR-PAS-343',
'C1-NAR-PAS-390',
'C1-NAR-PAS-685',
'C1-NAR-PAS-795',
'C1-NAR-PAS-807',
'C1-NAR-PAS-829',
'C1-NAR-PAS-861',
'C1-NAR-PAS-916',
'C1-NAR-PAS-1087',
'C1-NAR-PAS-304',
'C1-NAR-PAS-317',
'C1-NAR-PAS-628',
'C1-NAR-PAS-856',
'C1-NAR-PAS-893',
'C1-NAR-PAS-943',
'C1-NAR-PAS-649',
'C1-TOL-557',
'C1-TOL-131',
'C1-CUN-202',
'C1-CAU-027',
'C1-ANT-MED-146',
'C1-NAR-PAS-144',
'C1-NAR-PAS-253',
'C1-NAR-PAS-402',
'C1-NAR-PAS-408',
'C1-NAR-PAS-553',
'C1-NAR-PAS-624',
'C1-NAR-PAS-643',
'C1-NAR-PAS-788',
'C1-NAR-PAS-808',
'C1-NAR-PAS-825',
'C1-NAR-PAS-914',
'C1-NAR-PAS-924',
'C1-CAL-046',
'C1-CAL-086',
'C1-CAL-093',
'C1-CAL-126',
'C1-SAN-542',
'C1-CAU-197',
'C1-NAR-PAS-1038',
'C1-NAR-PAS-1086',
'C1-SAN-682',
'C1-BOY-018',
'C1-BOY-040',
'C1-BOY-206',
'C1-BOY-245',
'C1-HUI-311',
'C1-HUI-265',
'C1-HUI-305',
'C1-HUI-266',
'C1-NAR-PAS-418',
'C1-SAN-080',
'C1-SAN-334',
'C1-SAN-346',
'C1-SAN-409',
'C1-SAN-496',
'C1-NAR-PAS-1042',
'C1-NAR-PAS-300',
'C1-NAR-PAS-835',
'C1-NAR-PAS-951',
'C1-SAN-281',
'C1-SAN-693',
'C1-SAN-325',
'C1-VAL-115',
'C1-VAL-108',
'C1-NAR-PAS-001',
'C1-NAR-PAS-004',
'C1-NAR-PAS-021',
'C1-NAR-PAS-1054',
'C1-NAR-PAS-1073',
'C1-NAR-PAS-1089',
'C1-NAR-PAS-113',
'C1-NAR-PAS-1137',
'C1-NAR-PAS-150',
'C1-NAR-PAS-167',
'C1-NAR-PAS-215',
'C1-NAR-PAS-250',
'C1-NAR-PAS-252',
'C1-NAR-PAS-394',
'C1-NAR-PAS-396',
'C1-NAR-PAS-399',
'C1-NAR-PAS-405',
'C1-NAR-PAS-481',
'C1-NAR-PAS-497',
'C1-NAR-PAS-505',
'C1-NAR-PAS-554',
'C1-NAR-PAS-585',
'C1-NAR-PAS-614',
'C1-NAR-PAS-617',
'C1-NAR-PAS-675',
'C1-NAR-PAS-816',
'C1-NAR-PAS-894',
'C1-NAR-PAS-931',
'C1-NAR-PAS-936',
'C1-NAR-PAS-834',
'C1-BOY-162',
'C1-NAR-PAS-1066',
'C1-NAR-PAS-107',
'C1-NAR-PAS-114',
'C1-NAR-PAS-149',
'C1-NAR-PAS-210',
'C1-NAR-PAS-308',
'C1-NAR-PAS-314',
'C1-NAR-PAS-403',
'C1-NAR-PAS-428',
'C1-NAR-PAS-583',
'C1-NAR-PAS-920',
'C1-NAR-PAS-979',
'C1-NAR-PAS-975',
'C1-TOL-249',
'C1-TOL-220',
'C1-TOL-234',
'C1-TOL-713',
'C1-PUT-309',
'C1-TOL-105',
'C1-TOL-606',
'C1-NAR-PAS-1076',
'C1-NOR-065',
'C1-CUN-772',
'C1-HUI-238',
'C1-HUI-310',
'C1-HUI-391',
'C1-CUN-658',
'C1-CUN-621',
'C1-NAR-PAS-115',
'C1-NAR-PAS-525',
'C1-HUI-215',
'C1-HUI-239',
'C1-HUI-145',
'C1-BOY-222',
'C1-CUN-388',
'C1-SAN-753',
'C1-SAN-799',
'C1-SAN-787',
'C1-RIS-199',
'C1-SAN-782',
'C1-TOL-768',
'C1-RIS-114',
'C1-RIS-171',
'C1-BOY-119',
'C1-BOY-203',
'C1-BOY-261',
'C1-TOL-190',
'C1-TOL-271',
'C1-TOL-413',
'C1-TOL-530',
'C1-TOL-616',
'C1-TOL-841',
'C1-GUV-002',
'C1-NOR-024',
'C1-TOL-804',
'C1-PUT-487',
'C1-NAR-PAS-1153',
'C1-NAR-PAS-587',
'C1-TOL-737',
'C1-TOL-591',
'C1-CAU-216',
'C1-PUT-269',
'C1-CUN-314',
'C1-NAR-PAS-1124',
'C1-SAN-311',
'C1-CUN-780',
'C1-RIS-009',
'C1-HUI-188',
'C1-SAN-806',
'C1-HUI-169',
'C1-CUN-095',
'C1-VAL-092',
'C1-CUN-369',
'C1-NAR-PAS-946',
'C1-NAR-PAS-040',
'C1-NAR-PAS-1155',
'C1-NAR-PAS-756',
'C1-NAR-PAS-787',
'C1-NAR-PAS-981',
'C1-TOL-287',
'C1-TOL-061',
'C1-RIS-031',
'C1-BOY-142',
'C1-BOY-171',
'C1-TOL-525',
'C1-TOL-839',
'C1-PUT-585',
'C1-PUT-096',
'C1-PUT-424',
'C1-CUN-698',
'C1-CUN-764',
'C1-CAQ-401',
'C1-HUI-193',
'C1-CUN-799',
'C1-NAR-PAS-112',
'C1-CAU-126',
'C1-BOY-170',
'C1-HUI-044',
'C1-NAR-PAS-523',
'C1-CAL-340',
'C1-CUN-177',
'C1-CUN-651',
'C1-CUN-760',
'C1-ANT-MED-066',
'C1-SAN-174',
'C1-NAR-PAS-431',
'C1-NAR-PAS-568',
'C1-BOY-163',
'C1-TOL-758',
'C1-TOL-314',
'C1-TOL-531',
'C1-PUT-316',
'C1-CAQ-068',
'C1-SAN-720',
'C1-SAN-148',
'C1-BOY-263',
'C1-HUI-263',
'C1-NAR-PAS-419',
'C1-NAR-PAS-836',
'C1-NAR-PAS-845',
'C1-HUI-196',
'C1-NAR-PAS-1143',
'C1-NAR-PAS-454',
'C1-NAR-PAS-858',
'C1-NAR-PAS-945',
'C1-CAQ-217',
'C1-HUI-331',
'C1-SAN-780',
'C1-NAR-PAS-802',
'C1-ARA-039',
'C1-MAG-107',
'C1-NAR-PAS-025',
'C1-NAR-PAS-1097',
'C1-NAR-PAS-455',
'C1-NAR-PAS-516',
'C1-NAR-PAS-881',
'C1-PUT-250',
'C1-TOL-461',
'C1-TOL-569',
'C1-TOL-721',
'C1-TOL-117',
'C1-CAU-227',
'C1-NAR-PAS-162',
'C1-CAQ-106',
'C1-CAQ-400',
'C1-VAL-124',
'C1-SAN-141',
'C1-SAN-571',
'C1-PUT-043',
'C1-PUT-142',
'C1-NAR-PAS-145',
'C1-NAR-PAS-159',
'C1-NAR-PAS-257',
'C1-NAR-PAS-267',
'C1-NAR-PAS-280',
'C1-NAR-PAS-298',
'C1-NAR-PAS-446',
'C1-NAR-PAS-581',
'C1-NAR-PAS-592',
'C1-NAR-PAS-616',
'C1-NAR-PAS-889',
'C1-HUI-246',
'C1-HUI-319',
'C1-HUI-412',
'C1-CAU-095',
'C1-CAU-160',
'C1-CAU-171',
'C1-NAR-PAS-483',
'C1-NAR-PAS-042',
'C1-NAR-PAS-1110',
'C1-NAR-PAS-330',
'C1-NAR-PAS-350',
'C1-NAR-PAS-456',
'C1-NAR-PAS-478',
'C1-NAR-PAS-683',
'C1-NAR-PAS-725',
'C1-NAR-PAS-796',
'C1-NAR-PAS-781',
'C1-BOY-120',
'C1-BOY-252',
'C1-SAN-287',
'C1-CAL-070',
'C1-CAU-173',
'C1-ARA-014',
'C1-ARA-037',
'C1-VAL-015',
'C1-HUI-432',
'C1-TOL-830',
'C1-NOR-057',
'C1-TOL-028',
'C1-SAN-411',
'C1-PUT-034',
'C1-PUT-178',
'C1-PUT-436',
'C1-PUT-443',
'C1-PUT-448',
'C1-PUT-530',
'C1-PUT-569',
'C1-PUT-240',
'C1-TOL-781',
'C1-SAN-274',
'C1-NAR-PAS-197',
'C1-NAR-PAS-863',
'C1-CAQ-105',
'C1-CAQ-178',
'C1-CAQ-310',
'C1-CUN-054',
'C1-CUN-439',
'C1-CUN-730',
'C1-MAG-136',
'C1-RIS-017',
'C1-SAN-721',
'C1-SAN-740',
'C1-PUT-493',
'C1-ANT-MED-661',
'C1-HUI-223',
'C1-HUI-272',
'C1-HUI-421',
'C1-CUN-348',
'C1-CUN-746',
'C1-ANT-MED-330',
'C1-ANT-MED-746',
'C1-CUN-332',
'C1-CHO-026',
'C1-PUT-426',
'C1-HUI-209',
'C1-BOY-073',
'C1-SAN-286',
'C1-SAN-044',
'C1-SAN-711',
'C1-SAN-032',
'C1-NAR-PAS-035',
'C1-NAR-PAS-1008',
'C1-NAR-PAS-1013',
'C1-NAR-PAS-1024',
'C1-NAR-PAS-1119',
'C1-NAR-PAS-1129',
'C1-NAR-PAS-1132',
'C1-NAR-PAS-339',
'C1-NAR-PAS-356',
'C1-NAR-PAS-383',
'C1-NAR-PAS-599',
'C1-NAR-PAS-814',
'C1-BOY-228',
'C1-PUT-166',
'C1-PUT-555',
'C1-HUI-387',
'C1-HUI-221',
'C1-PUT-212',
'C1-PUT-681',
'C1-GUA-028',
'C1-CUN-636',
'C1-NAR-PAS-1161',
'C1-NAR-PAS-233',
'C1-CUN-435',
'C1-CAQ-159',
'C1-CAU-206',
'C1-SAN-104',
'C1-BOY-267',
'C1-HUI-285',
'C1-HUI-361',
'C1-HUI-282',
'C1-CUN-188',
'C1-CUN-199',
'C1-CUN-873',
'C1-CUN-548',
'C1-ANT-MED-279',
'C1-ANT-MED-404',
'C1-SAN-071',
'C1-SAN-232',
'C1-SAN-249',
'C1-SAN-456',
'C1-SAN-537',
'C1-SAN-680',
'C1-NAR-PAS-029',
'C1-NAR-PAS-307',
'C1-NAR-PAS-537',
'C1-NAR-PAS-860',
'C1-RIS-163',
'C1-RIS-202',
'C1-SAN-538',
'C1-SAN-545',
'C1-SAN-732',
'C1-CUN-644',
'C1-CUN-692',
'C1-RIS-170',
'C1-VAL-074',
'C1-VAL-096',
'C1-HUI-264',
'C1-COR-095',
'C1-HUI-386',
'C1-QUI-104',
'C1-QUI-109',
'C1-CAQ-120',
'C1-AMA-001',
'C1-RIS-143',
'C1-NAR-TUM-018',
'C1-NAR-TUM-022',
'C1-NAR-TUM-024',
'C1-NAR-TUM-026',
'C1-NAR-TUM-030',
'C1-NAR-TUM-033',
'C1-ANT-MED-043',
'C1-ANT-MED-088',
'C1-HUI-356',
'C1-GUA-038',
'C1-BOY-258',
'C1-TOL-040',
'C1-TOL-526',
'C1-TOL-656',
'C1-TOL-740',
'C1-TOL-769',
'C1-TOL-775',
'C1-TOL-797',
'C1-TOL-837',
'C1-TOL-119',
'C1-RIS-028',
'C1-RIS-061',
'C1-CAL-060',
'C1-TOL-410',
'C1-SAN-592',
'C1-SAN-667',
'C1-NAR-PAS-794',
'C1-TOL-635',
'C1-CAQ-134',
'C1-QUI-056',
'C1-RIS-134',
'C1-ARA-011',
'C1-ARA-046',
'C1-COR-080',
'C1-CAL-429',
'C1-CAL-004',
'C1-HUI-294',
'C1-SUC-020',
'C1-HUI-433',
'C1-TOL-192',
'C1-BOY-002',
'C1-BOY-122',
'C1-BOY-128',
'C1-BOY-201',
'C1-BOY-205',
'C1-BOY-209',
'C1-BOY-231',
'C1-BOY-239',
'C1-BOY-243',
'C1-BOY-250',
'C1-TOL-706',
'C1-CAQ-293',
'C1-CAQ-372',
'C1-MAG-129',
'C1-CES-139',
'C1-RIS-144',
'C1-CUN-342',
'C1-RIS-132',
'C1-CUN-249',
'C1-TOL-765',
'C1-ATL-012',
'C1-VAL-119',
'C1-NAR-PAS-734',
'C1-TOL-730',
'C1-TOL-733',
'C1-TOL-819',
'C1-PUT-546',
'C1-CUN-864',
'C1-CES-045',
'C1-CUN-756',
'C1-CUN-517',
'C1-TOL-722',
'C1-HUI-330',
'C1-CUN-549',
'C1-CUN-589',
'C1-CUN-803',
'C1-VAL-102',
'C1-CAL-195',
'C1-CAL-203',
'C1-CAL-214',
'C1-CAL-241',
'C1-QUI-155',
'C1-QUI-092',
'C1-TOL-270',
'C1-QUI-111',
'C1-CES-039',
'C1-TOL-168',
'C1-TOL-365',
'C1-TOL-820',
'C1-SUC-003',
'C1-ARA-034',
'C1-ATL-023',
'C1-CAQ-168',
'C1-CUN-759',
'C1-HUI-448',
'C1-SAN-559',
'C1-CAL-218',
'C1-VIC-011',
'C1-VIC-063',
'C1-VIC-072',
'C1-VIC-075',
'C1-VIC-082',
'C1-VIC-084',
'C1-VIC-087',
'C1-VIC-091',
'C1-VIC-094',
'C1-VIC-095',
'C1-VIC-105',
'C1-VIC-106',
'C1-VIC-107',
'C1-VIC-108',
'C1-VIC-110',
'C1-VIC-113',
'C1-RIS-030',
'C1-RIS-156',
'C1-VAL-066',
'C1-TOL-380',
'C1-SAN-090',
'C1-SAN-652',
'C1-RIS-117',
'C1-MAG-088',
'C1-CAL-012',
'C1-CAL-361',
'C1-CAL-422',
'C1-SAN-147',
'C1-CUN-660',
'C1-ANT-MED-667',
'C1-CAL-227',
'C1-CAL-228',
'C1-CAL-297',
'C1-CAL-272',
'C1-MAG-073',
'C1-TOL-132',
'C1-CAL-270',
'C1-RIS-140',
'C1-RIS-130',
'C1-RIS-193',
'C1-ANT-MED-105',
'C1-TOL-064',
'C1-TOL-085',
'C1-TOL-145',
'C1-TOL-382',
'C1-TOL-490',
'C1-TOL-505',
'C1-TOL-771',
'C1-TOL-785',
'C1-RIS-006',
'C1-RIS-113',
'C1-RIS-161',
'C1-RIS-213',
'C1-RIS-040',
'C1-CUN-514',
'C1-QUI-003',
'C1-CUN-039',
'C1-CUN-813',
'C1-CUN-857',
'C1-CUN-861',
'C1-QUI-014',
'C1-TOL-483',
'C1-RIS-014',
'C1-QUI-008',
'C1-SAN-690',
'C1-ATL-001',
'C1-CAL-049',
'C1-CUN-281',
'C1-NOR-034',
'C1-QUI-002',
'C1-TOL-402',
'C1-CAL-327',
'C1-PUT-199',
'C1-QUI-050',
'C1-QUI-061',
'C1-CAS-042',
'C1-BOY-237',
'C1-BOY-256',
'C1-CUN-216',
'C1-CUN-635',
'C1-CAL-423',
'C1-PUT-218',
'C1-PUT-304',
'C1-PUT-392',
'C1-PUT-406',
'C1-CAL-025',
'C1-CAL-110',
'C1-TOL-381',
'C1-HUI-306',
'C1-CAL-062',
'C1-CAL-337',
'C1-CAL-032',
'C1-CAL-099',
'C1-CAL-102',
'C1-CAL-166',
'C1-CAL-174',
'C1-CAL-329',
'C1-CUN-404',
'C1-CUN-547',
'C1-TOL-239',
'C1-VAL-164',
'C1-CAU-028',
'C1-BOY-088',
'C1-CUN-431',
'C1-TOL-019',
'C1-TOL-049',
'C1-TOL-091',
'C1-TOL-653',
'C1-ANT-URB-016',
'C1-VAL-037',
'C1-VAL-134',
'C1-QUI-010',
'C1-BOY-135',
'C1-RIS-177',
'C1-QUI-132',
'C1-BOY-054',
'C1-HUI-322',
'C1-TOL-599',
'C1-TOL-666',
'C1-TOL-680',
'C1-TOL-753',
'C1-TOL-816',
'C1-ANT-URB-075',
'C1-PUT-007',
'C1-PUT-187',
'C1-PUT-296',
'C1-QUI-036',
'C1-SAN-809',
'C1-QUI-078',
'C1-CAS-031',
'C1-SAN-540',
'C1-BOY-034',
'C1-BOY-160',
'C1-BOY-194',
'C1-BOY-210',
'C1-VAL-126',
'C1-SAN-302',
'C1-SAN-577',
'C1-SAN-628',
'C1-RIS-168',
'C1-TOL-181',
'C1-NAR-PAS-1072',
'C1-ANT-URB-093',
'C1-SAN-143',
'C1-RIS-098',
'C1-QUI-114',
'C1-SAN-013',
'C1-SAN-369',
'C1-SAN-414',
'C1-SAN-503',
'C1-SAN-510',
'C1-SAN-552',
'C1-SAN-615',
'C1-SAN-620',
'C1-SAN-623',
'C1-SAN-647',
'C1-CAQ-233',
'C1-NAR-PAS-1108',
'C1-NAR-PAS-1126',
'C1-NAR-PAS-147',
'C1-NAR-PAS-313',
'C1-NAR-PAS-319',
'C1-NAR-PAS-333',
'C1-NAR-PAS-337',
'C1-NAR-PAS-367',
'C1-NAR-PAS-471',
'C1-NAR-PAS-508',
'C1-NAR-PAS-641',
'C1-NAR-PAS-750',
'C1-NAR-PAS-810',
'C1-NAR-PAS-873',
'C1-NAR-PAS-900',
'C1-NAR-PAS-468',
'C1-CUN-460',
'C1-VAL-020',
'C1-VAL-040',
'C1-CAQ-382',
'C1-SAN-579',
'C1-CAL-190',
'C1-HUI-214',
'C1-VAL-008',
'C1-HUI-172',
'C1-MAG-056',
'C1-HUI-250',
'C1-TOL-160',
'C1-TOL-293',
'C1-TOL-418',
'C1-TOL-823',
'C1-BOY-123',
'C1-BOY-246',
'C1-CUN-240',
'D1-QUI-025',
'D1-CAQ-169',
'D1-NAR-PAS-732',
'D1-NAR-PAS-990',
'D1-CAU-166',
'D1-NAR-PAS-1014',
'D1-QUI-147',
'D1-SAN-176',
'D1-CUN-699',
'D1-CUN-330',
'D1-PUT-662',
'D1-TOL-767',
'D1-NOR-087',
'D1-CAQ-203',
'D1-NAR-PAS-146',
'D1-NAR-PAS-973',
'D1-SAN-801',
'D1-NOR-096',
'D1-HUI-059',
'D1-NAR-PAS-1049',
'D1-CAQ-083',
'D1-CUN-545',
'D1-NAR-PAS-786',
'D1-NAR-PAS-226',
'D1-CAU-038',
'D1-CAQ-084',
'D1-PUT-089',
'D1-NAR-PAS-010',
'D1-NAR-PAS-024',
'D1-NAR-PAS-094',
'D1-NAR-PAS-098',
'D1-NAR-PAS-1111',
'D1-NAR-PAS-848',
'D1-COR-033',
'D1-NAR-PAS-501',
'D1-NAR-PAS-634',
'D1-NAR-PAS-650',
'D1-VIC-086',
'D1-VIC-016',
'D1-VIC-019',
'D1-VIC-026',
'D1-VIC-037',
'D1-VIC-039',
'D1-VIC-056',
'D1-ANT-URB-023',
'D1-NAR-PAS-053',
'D1-PUT-098',
'D1-PUT-468',
'D1-CUN-349',
'D1-HUI-077',
'D1-TOL-263',
'D1-NAR-PAS-801',
'D1-VAL-005',
'D1-COR-044',
'D1-CAQ-279',
'D1-PUT-164',
'D1-PUT-251',
'D1-COR-012',
'D1-ANT-URB-106',
'D1-NAR-PAS-037',
'D1-NAR-PAS-425',
'D1-CAU-037',
'D1-PUT-024',
'D1-MAG-065',
'D1-MAG-141',
'D1-ANT-MED-360',
'D1-ANT-MED-050',
'D1-TOL-023',
'D1-PUT-016',
'D1-RIS-051',
'D1-ANT-MED-333',
'D1-SUC-013',
'D1-NAR-PAS-311',
'D1-SAN-583',
'D1-NAR-PAS-041',
'D1-NAR-PAS-148',
'D1-CAU-061',
'D1-CAU-169',
'D1-CUN-247',
'D1-CUN-766',
'D1-NAR-PAS-224',
'D1-HUI-029',
'D1-RIS-139',
'D1-CAQ-046',
'D1-CAQ-103',
'D1-CAQ-161',
'D1-CAQ-243',
'D1-CAQ-317',
'D1-CAQ-338',
'D1-SAN-323',
'D1-NAR-PAS-518',
'D1-NAR-PAS-642',
'D1-CUN-114',
'D1-SAN-770',
'D1-NAR-PAS-1052',
'D1-CAU-052',
'D1-ARA-067',
'D1-TOL-501',
'D1-HUI-072',
'D1-BOY-024',
'D1-CUN-399',
'D1-CUN-590',
'D1-QUI-093',
'D1-NAR-PAS-045',
'D1-NAR-PAS-582',
'D1-BOY-019',
'D1-CAU-119',
'D1-NAR-PAS-507',
'D1-SAN-679',
'D1-NAR-PAS-646',
'D1-NAR-PAS-503',
'D1-ARA-056',
'D1-CAU-081',
'D1-SAN-681',
'D1-TOL-665',
'D1-NAR-PAS-048',
'D1-NAR-PAS-062',
'D1-NAR-PAS-1107',
'D1-NAR-PAS-522',
'D1-NAR-PAS-563',
'D1-NAR-PAS-703',
'D1-CUN-801',
'D1-CAU-124',
'D1-CAU-146',
'D1-CAU-230',
'D1-CAU-265',
'D1-MAG-068',
'D1-MAG-202',
'D1-CUN-893',
'D1-NAR-PAS-1009',
'D1-NAR-PAS-1163',
'D1-NAR-PAS-407',
'D1-NAR-PAS-639',
'D1-NAR-PAS-841',
'D1-NAR-PAS-043',
'D1-NAR-PAS-079',
'D1-NAR-PAS-594',
'D1-NAR-PAS-764',
'D1-CUN-386',
'D1-RIS-135',
'D1-NAR-PAS-382',
'D1-NAR-PAS-086',
'D1-NAR-PAS-1074',
'D1-ARA-053',
'D1-HUI-124',
'D1-NAR-PAS-059',
'D1-NAR-PAS-1048',
'D1-BOY-115',
'D1-TOL-224',
'D1-NAR-PAS-193',
'D1-CUN-235',
'D1-NAR-PAS-410',
'D1-TOL-544',
'D1-ANT-MED-448',
'D1-CAL-035',
'D1-CAL-071',
'D1-CAL-132',
'D1-CAL-187',
'D1-SAN-327',
'D1-CAQ-160',
'D1-NAR-PAS-072',
'D1-NAR-PAS-1040',
'D1-NAR-PAS-1068',
'D1-NAR-PAS-154',
'D1-NAR-PAS-206',
'D1-NAR-PAS-213',
'D1-NAR-PAS-261',
'D1-NAR-PAS-295',
'D1-NAR-PAS-336',
'D1-NAR-PAS-359',
'D1-NAR-PAS-494',
'D1-NAR-PAS-572',
'D1-NAR-PAS-577',
'D1-NAR-PAS-672',
'D1-NAR-PAS-677',
'D1-NAR-PAS-752',
'D1-NAR-PAS-870',
'D1-NAR-PAS-872',
'D1-NAR-PAS-922',
'D1-NAR-PAS-942',
'D1-NAR-PAS-989',
'D1-CUN-339',
'D1-NAR-PAS-813',
'D1-CUN-017',
'D1-CUN-089',
'D1-CUN-815',
'D1-NAR-PAS-118',
'D1-NAR-PAS-287',
'D1-NAR-PAS-303',
'D1-NAR-PAS-453',
'D1-CES-154',
'D1-CUN-381',
'D1-NAR-PAS-275',
'D1-NAR-PAS-276',
'D1-NAR-PAS-699',
'D1-CUN-373',
'D1-RIS-035',
'D1-SAN-601',
'D1-PUT-085',
'D1-NAR-PAS-262',
'D1-NAR-PAS-438',
'D1-NAR-PAS-556',
'D1-NAR-PAS-635',
'D1-NAR-PAS-887',
'D1-TOL-685',
'D1-GUV-013',
'D1-NAR-PAS-142',
'D1-CUN-697',
'D1-NAR-PAS-540',
'D1-CAQ-171',
'D1-NAR-PAS-089',
'D1-NAR-PAS-1035',
'D1-NAR-PAS-116',
'D1-NAR-PAS-171',
'D1-NAR-PAS-344',
'D1-NAR-PAS-348',
'D1-NAR-PAS-391',
'D1-NAR-PAS-573',
'D1-NAR-PAS-652',
'D1-NAR-PAS-687',
'D1-NAR-PAS-718',
'D1-NAR-PAS-771',
'D1-NAR-PAS-799',
'D1-NAR-PAS-984',
'D1-NAR-PAS-724',
'D1-CAL-007',
'D1-CAL-020',
'D1-CAL-024',
'D1-CAL-043',
'D1-CAL-051',
'D1-CAL-096',
'D1-CAL-112',
'D1-CAL-137',
'D1-CAL-155',
'D1-CAL-162',
'D1-CAL-259',
'D1-CAL-292',
'D1-CUN-223',
'D1-CUN-371',
'D1-TOL-622',
'D1-CUN-485',
'D1-CUN-862',
'D1-NAR-PAS-1037',
'D1-NAR-PAS-1092',
'D1-NAR-PAS-710',
'D1-NAR-PAS-849',
'D1-VAL-044',
'D1-CUN-618',
'D1-NAR-PAS-093',
'D1-NAR-PAS-398',
'D1-SAN-225',
'D1-SAN-229',
'D1-HUI-158',
'D1-CAL-192',
'D1-SAN-295',
'D1-SAN-730',
'D1-NAR-PAS-384',
'D1-NAR-PAS-028',
'D1-NAR-PAS-030',
'D1-NAR-PAS-078',
'D1-NAR-PAS-401',
'D1-NAR-PAS-412',
'D1-NAR-PAS-472',
'D1-NAR-PAS-625',
'D1-NAR-PAS-884',
'D1-TOL-698',
'D1-MAG-054',
'D1-CUN-034',
'D1-PUT-293',
'D1-CUN-049',
'D1-CUN-436',
'D1-CUN-486',
'D1-QUI-160',
'D1-TOL-667',
'D1-CUN-182',
'D1-ARA-086',
'D1-CUN-215',
'D1-CUN-006',
'D1-BOY-077',
'D1-HUI-137',
'D1-NAR-PAS-619',
'D1-PUT-076',
'D1-RIS-093',
'D1-CAU-190',
'D1-NAR-PAS-006',
'D1-NAR-PAS-1067',
'D1-MAG-099',
'D1-CUN-056',
'D1-CUN-241',
'D1-CUN-667',
'D1-AMA-005',
'D1-NAR-PAS-135',
'D1-TOL-017',
'D1-CUN-531',
'D1-PUT-559',
'D1-PUT-524',
'D1-PUT-558',
'D1-HUI-062',
'D1-CES-091',
'D1-ANT-MED-695',
'D1-ANT-MED-294',
'D1-RIS-147',
'D1-VAL-071',
'D1-PUT-074',
'D1-CUN-811',
'D1-CUN-071',
'D1-CUN-530',
'D1-CUN-568',
'D1-TOL-059',
'D1-SUC-066',
'D1-TOL-586',
'D1-ANT-MED-063',
'D1-ANT-MED-064',
'D1-ANT-MED-219',
'D1-CAQ-202',
'D1-RIS-082',
'D1-CUN-448',
'D1-PUT-119',
'D1-TOL-086',
'D1-CUN-061',
'D1-CUN-320',
'D1-CUN-380',
'D1-SAN-068',
'D1-CAQ-375',
'D1-CAQ-394',
'D1-NAR-PAS-204',
'D1-CAU-034',
'D1-CAU-134',
'D1-HUI-002',
'D1-HUI-092',
'D1-CAL-345',
'D1-CUN-511',
'D1-SAN-641',
'D1-MAG-081',
'D1-CUN-422',
'D1-CUN-541',
'D1-CUN-631',
'D1-CUN-721',
'D1-CUN-744',
'D1-CUN-558',
'D1-NAR-PAS-207',
'D1-NAR-PAS-352',
'D1-NAR-PAS-373',
'D1-CUN-368',
'D1-CAQ-127',
'D1-CAQ-339',
'D1-HUI-112',
'D1-HUI-028',
'D1-HUI-119',
'D1-NAR-PAS-954',
'D1-NAR-PAS-088',
'D1-NAR-PAS-623',
'D1-ARA-073',
'D1-CUN-143',
'D1-CUN-152',
'D1-CUN-891',
'D1-PUT-563',
'D1-NAR-PAS-1000',
'D1-NAR-PAS-127',
'D1-NAR-PAS-132',
'D1-NAR-PAS-133',
'D1-NAR-PAS-381',
'D1-NAR-PAS-448',
'D1-NAR-PAS-449',
'D1-NAR-PAS-618',
'D1-NAR-PAS-621',
'D1-NAR-PAS-878',
'D1-NAR-PAS-886',
'D1-MET-012',
'D1-TOL-012',
'D1-CUN-210',
'D1-NAR-PAS-101',
'D1-NAR-PAS-392',
'D1-NAR-PAS-962',
'D1-CAU-250',
'D1-TOL-081',
'D1-RIS-016',
'D1-CUN-783',
'D1-CAQ-031',
'D1-NAR-PAS-090',
'D1-NAR-PAS-340',
'D1-NAR-PAS-366',
'D1-NAR-PAS-459',
'D1-NAR-PAS-580',
'D1-CAU-077',
'D1-CAU-118',
'D1-CAU-244',
'D1-CUN-353',
'D1-CUN-711',
'D1-CUN-701',
'D1-CES-186',
'D1-ARA-052',
'D1-PUT-343',
'D1-RIS-079',
'D1-NAR-PAS-697',
'D1-SAN-822',
'D1-PUT-040',
'D1-PUT-144',
'D1-PUT-188',
'D1-PUT-460',
'D1-CAQ-062',
'D1-CUN-394',
'D1-CUN-379',
'D1-CUN-753',
'D1-CUN-858',
'D1-SAN-018',
'D1-GUV-053',
'D1-CAL-021',
'D1-PUT-435',
'D1-PUT-626',
'D1-PUT-627',
'D1-MAG-158',
'D1-NAR-PAS-1029',
'D1-CUN-284',
'D1-TOL-183',
'D1-CUN-025',
'D1-ANT-MED-114',
'D1-ANT-MED-252',
'D1-ANT-MED-427',
'D1-ANT-MED-512',
'D1-TOL-073',
'D1-CUN-016',
'D1-CUN-506',
'D1-PUT-219',
'D1-HUI-027',
'D1-HUI-129',
'D1-CAQ-273',
'D1-SAN-047',
'D1-SAN-050',
'D1-NAR-PAS-1002',
'D1-NAR-PAS-230',
'D1-NAR-PAS-590',
'D1-NAR-PAS-689',
'D1-ARA-089',
'D1-PUT-620',
'D1-HUI-417',
'D1-TOL-634',
'D1-QUI-086',
'D1-CAQ-318',
'D1-ARA-083',
'D1-ARA-097',
'D1-NAR-PAS-047',
'D1-NAR-PAS-395',
'D1-NAR-PAS-584',
'D1-ANT-MED-354',
'D1-TOL-348',
'D1-CUN-053',
'D1-HUI-084',
'D1-HUI-090',
'D1-CUN-479',
'D1-CAQ-256',
'D1-CAQ-308',
'D1-ARA-071',
'D1-ARA-077',
'D1-VAL-038',
'D1-NAR-PAS-222',
'D1-NAR-PAS-411',
'D1-NAR-PAS-544',
'D1-CUN-882',
'D1-ANT-URB-014',
'D1-MAG-058',
'D1-MAG-137',
'D1-MAG-203',
'D1-HUI-123',
'D1-PUT-205',
'D1-QUI-117',
'D1-CES-103',
'D1-ARA-093',
'D1-ARA-082',
'D1-TOL-172',
'D1-HUI-035',
'D1-VAL-090',
'D1-MAG-095',
'D1-RIS-078',
'D1-RIS-120',
'D1-MAG-005',
'D1-NAR-PAS-837',
'D1-NAR-PAS-671',
'D1-ANT-MED-014',
'D1-CUN-136',
'D1-AMA-003',
'D1-HUI-135',
'D1-HUI-128',
'D1-TOL-161',
'D1-VAL-103',
'D1-TOL-177',
'D1-GUV-044',
'D1-ATL-051',
'D1-RIS-064',
'D1-RIS-060',
'D1-SUC-021',
'D1-RIS-020',
'D1-MAG-210',
'D1-NAR-PAS-737',
'D1-CUN-842',
'D1-CES-178',
'D1-CUN-148',
'D1-RIS-012',
'D1-COR-028',
'D1-CUN-391',
'D1-VAL-082',
'D1-CUN-395',
'D1-CAQ-254',
'D1-PUT-650',
'D1-CUN-761',
'D1-CUN-254',
'D1-COR-067',
'D1-RIS-184',
'D1-QUI-116',
'D1-QUI-034',
'D1-PUT-657',
'D1-CUN-078',
'D1-CUN-393',
'D1-CUN-489',
'D1-CUN-592',
'D1-CUN-749',
'D1-CAL-147',
'D1-CAL-311',
'D1-QUI-089',
'D1-TOL-330',
'D1-TOL-621',
'D1-TOL-731',
'D1-CES-148',
'D1-VAL-052',
'D1-RIS-104',
'D1-RIS-153',
'D1-PUT-211',
'D1-PUT-648',
'D1-CUN-722',
'D1-CAL-108',
'D1-CAL-116',
'D1-CAL-148',
'D1-CAL-256',
'D1-CAL-321',
'D1-CAL-330',
'D1-CAL-350',
'D1-PUT-185',
'D1-TOL-222',
'D1-CUN-462',
'D1-TOL-672',
'D1-GUA-101',
'D1-CUN-779',
'D1-PUT-058',
'D1-CAQ-275',
'D1-COR-026',
'D1-RIS-102',
'D1-RIS-212',
'D1-SAN-150',
'D1-VAL-138',
'D1-QUI-021',
'D1-CES-140',
'D1-GUA-012',
'D1-CAQ-219',
'D1-VIC-012',
'D1-VIC-018',
'D1-VIC-045',
'D1-RIS-059',
'D1-CUN-849',
'D1-RIS-057',
'D1-RIS-111',
'D1-VAL-004',
'D1-CUN-070',
'D1-CUN-708',
'D1-QUI-115',
'D1-CUN-117',
'D1-GUA-087',
'D1-GUA-108',
'D1-CAL-294',
'D1-CAL-275',
'D1-CUN-695',
'D1-QUI-098',
'D1-QUI-139',
'D1-VAL-060',
'D1-CUN-607',
'D1-CUN-360',
'D1-ANT-MED-328',
'D1-RIS-088',
'D1-ANT-MED-361',
'D1-CAQ-326',
'D1-CAQ-347',
'D1-ANT-MED-483',
'D1-ARA-061',
'D1-ARA-079',
'D1-RIS-101',
'D1-CAQ-333',
'D1-ANT-MED-633',
'D1-BOY-098',
'D1-MAG-028',
'D1-VAL-145',
'D1-CUN-043',
'D1-RIS-070',
'D1-RIS-092',
'D1-CUN-248',
'D1-VAL-007',
'D1-ANT-MED-444',
'D1-CAL-023',
'D1-QUI-112',
'D1-QUI-076',
'D1-QUI-101',
'D1-QUI-108',
'D1-CUN-222',
'D1-CUN-829',
'D1-CUN-508',
'D1-VAL-012',
'D1-CAL-268',
'D1-CAL-036',
'D1-RIS-047',
'D1-TOL-285',
'D1-CUN-181',
'D1-CUN-798',
'D1-CUN-573',
'D1-CAL-064',
'D1-CAL-013',
'D1-CUN-414',
'D1-CUN-724',
'D1-TOL-144',
'D1-TOL-495',
'D1-PUT-128',
'D1-QUI-075',
'D1-TOL-815',
'D1-CUN-481',
'D1-CUN-565',
'D1-CUN-754',
'D1-CUN-782',
'D1-CUN-806',
'D1-CUN-828',
'D1-TOL-030',
'D1-TOL-272',
'D1-TOL-523',
'D1-TOL-829',
'D1-CUN-787',
'D1-CAU-103',
'D1-CAU-225',
'D1-RIS-041',
'D1-HUI-108',
'D1-PUT-673',
'D1-QUI-136',
'D1-HUI-070',
'D1-PUT-201',
'D1-PUT-253',
'D1-PUT-539',
'D1-SAN-159',
'D1-QUI-124',
'D1-MAG-166',
'D1-CUN-389',
'D1-HUI-100',
'D1-TOL-015',
'D1-TOL-302',
'D1-NAR-PAS-1010',
'D1-CUN-673',
'D1-RIS-074',
'D1-RIS-023',
'D1-SAN-699',
'D1-QUI-038',
'D1-QUI-121',
'D1-CAQ-227',
'D1-NAR-PAS-1157',
'D1-NAR-PAS-173',
'D1-NAR-PAS-762',
'D1-NAR-PAS-730',
'D1-CAU-032',
'D1-SAN-155',
'D1-SAN-772',
'D1-CAL-347',
'D1-MAG-004',
'D1-RIS-068',
'D1-RIS-080',
'D1-NOR-079',
'D1-SAN-582',
'D1-CAS-041',
'D1-CAQ-078',
'D1-MET-017',
'D1-NAR-PAS-1165',
'D1-NAR-PAS-170',
'D1-NAR-PAS-502',
'D1-NAR-PAS-598',
'D1-NAR-PAS-811',
'D1-NAR-PAS-930',
'D1-CAU-059',
'D1-VAL-027',
'D1-RIS-200',
'D1-CAQ-184',
'D1-CAQ-198',
'D1-CAU-136',
'D1-MAG-184',
'D1-HUI-089',
'D1-HUI-104',
'D1-CAU-076',
'D1-CAU-106',
'D1-CAU-192',
'D1-CAU-260',
'D1-MAG-126',
'D1-CAL-009',
'D1-CAL-274',
'D1-HUI-053',
'D1-TOL-096',
'D1-TOL-153',
'D1-TOL-322',
'D1-TOL-757',
'D1-RIS-186',
'D1-SAN-201',
'D1-SAN-310',
'MD1-NAR-PAS-361',
'MD1-NAR-PAS-379',
'MD1-NAR-PAS-645',
'MD1-NAR-PAS-896',
'MD1-CAL-039',
'MD1-CAL-075',
'MD1-CAL-146',
'MD1-CAL-253',
'MD1-SAN-315',
'MD1-CUN-246',
'MD1-CUN-259',
'MD1-RIS-039',
'MD1-NAR-PAS-713',
'MD1-SAN-226',
'MD1-SAN-227',
'MD1-HUI-049',
'MD1-NAR-PAS-056',
'MD1-NAR-PAS-110',
'MD1-NAR-PAS-510',
'MD1-NAR-PAS-596',
'MD1-CUN-106',
'MD1-BOY-009',
'MD1-PUT-541',
'MD1-HUI-122',
'MD1-NAR-PAS-698',
'MD1-CUN-336',
'MD1-PUT-302',
'MD1-PUT-180',
'MD1-HUI-087',
'MD1-CUN-418',
'MD1-RIS-025',
'MD1-CUN-500',
'MD1-NAR-PAS-068',
'MD1-NAR-PAS-534',
'MD1-NAR-PAS-804',
'MD1-PUT-583',
'MD1-SAN-222',
'MD1-CUN-073',
'MD1-CAL-385',
'MD1-ANT-MED-223',
'MD1-CUN-538',
'MD1-CUN-245',
'MD1-CUN-610',
'MD1-CUN-880',
'MD1-NAR-PAS-903',
'MD1-PUT-552',
'MD1-ANT-MED-203',
'MD1-ANT-MED-205',
'MD1-CAU-013',
'MD1-BOY-017',
'MD1-CUN-894',
'MD1-NAR-PAS-180',
'MD1-NAR-PAS-855',
'MD1-NAR-PAS-386',
'MD1-NAR-PAS-720',
'MD1-NAR-PAS-871',
'MD1-CAQ-270',
'MD1-SAN-106',
'MD1-PUT-425',
'MD1-CUN-119',
'MD1-NAR-PAS-044',
'MD1-NAR-PAS-358',
'MD1-NAR-PAS-576',
'MD1-CAU-236',
'MD1-ARA-087',
'MD1-HUI-131',
'MD1-SAN-479',
'MD1-ARA-058',
'MD1-HUI-073',
'MD1-CAQ-022',
'MD1-CAQ-088',
'MD1-SAN-045',
'MD1-CAL-167',
'MD1-PUT-480',
'MD1-NAR-PAS-567',
'MD1-HUI-134',
'MD1-NAR-PAS-779',
'MD1-CUN-455',
'MD1-CUN-492',
'MD1-CUN-552',
'MD1-ANT-MED-740',
'MD1-ANT-MED-750',
'MD1-CUN-885',
'MD1-HUI-082',
'MD1-NAR-PAS-347',
'MD1-NAR-PAS-997',
'MD1-TOL-497',
'MD1-TOL-577',
'MD1-CAU-006',
'MD1-HUI-121',
'MD1-ANT-MED-665',
'MD1-HUI-133',
'MD1-NAR-PAS-108',
'MD1-NAR-PAS-427',
'MD1-COR-017',
'MD1-CUN-363',
'MD1-CAQ-253',
'MD1-HUI-023',
'MD1-HUI-086',
'MD1-HUI-079',
'MD1-HUI-154',
'MD1-CUN-063',
'MD1-ANT-MED-768',
'MD1-CAQ-186',
'MD1-CAQ-335',
'MD1-CUN-267',
'MD1-CAS-024',
'MD1-PUT-666',
'MD1-CUN-516',
'MD1-CUN-844',
'MD1-CUN-165',
'MD1-CUN-274',
'MD1-VAL-116',
'MD1-NAR-PAS-231',
'MD1-CUN-446',
'MD1-SAN-629',
'MD1-NAR-PAS-655',
'MD1-VIC-076',
'MD1-COR-027',
'MD1-RIS-167',
'MD1-CUN-575',
'MD1-CUN-742',
'MD1-RIS-145',
'MD1-RIS-099',
'MD1-ARA-076',
'MD1-RIS-095',
'MD1-CAQ-322',
'MD1-VAL-019',
'MD1-CUN-478',
'MD1-CUN-534',
'MD1-CAL-392',
'MD1-CAL-040',
'MD1-CUN-037',
'MD1-QUI-066',
'MD1-ANT-MED-075',
'MD1-CUN-329',
'MD1-CUN-294',
'MD1-CUN-622',
'MD1-CUN-649',
'MD1-PUT-427',
'MD1-HUI-080',
'MD1-TOL-670',
'MD1-PUT-289',
'MD1-MAG-163',
'MD1-CUN-823',
'MD1-CUN-678',
'MD1-TOL-235',
'MD1-TOL-655',
'MD1-CUN-003',
'MD1-CAU-141',
'MD1-VAL-097',
'MD1-CUN-082',
'MD1-HUI-063',
'MD1-PUT-519',
'MD1-NAR-PAS-1149',
'MD1-QUI-017',
'MD1-NAR-PAS-071',
'MD1-NAR-PAS-663',
'MD1-NAR-PAS-769',
'MD1-NAR-PAS-1025',
'MD1-NAR-PAS-791',
'MD1-NAR-PAS-969',
'MD1-RIS-084',
'MD1-RIS-107',
'MD1-VAL-034',
'MD1-CAQ-242',
'MD1-CAQ-323',
'MD1-CUN-845',
'MD1-VAL-021',
'MD1-MAG-196',
'MD1-TOL-082',
'MD1-RIS-018',
'MD1-CUN-657')AND c.username NOT IN ('ESTASUR1','ESTASUR2','CREAR2','CREAR3','fbejarano2') ORDER BY c.username ASC";

        $results = $this->Poll->query($sql);

        // The column headings of your .csv file
        $header_row = array("id", "Código", "Epsagro", "verificación_fase_uno", "descripción_verificación_fase_uno", "visto_bueno", "descripción_visto_bueno", "calificación_características_biofísicas", "concepto_biofísico_agrológico", "calificación_sociales", "concepto_social", "calificación_económicos", "concepto_económico", "calificación_ambientales", "concepto_ambiental", "descripción_vías_internas", "georeferenciación", "Publicación");

        $newRow = array();

        foreach ($header_row as $a) {
            $newRow[] = iconv('UTF-8', 'Windows-1252', $a);
        }

        fputcsv($csv_file, $newRow, ';', '"');

        $publicacion = "";

        // Each iteration of this while loop will be a row in your .csv file where each field corresponds to the heading of the column
        foreach ($results as $result) {
            // Array indexes correspond to the field names in your db table(s)
            if ($result['d']['estado'] == 1) {
                $publicacion = "Si";
            } else {
                $publicacion = "No";
            }
            $row = array(
                $result['a']['id'],
                $result['a']['codigo'],
                $result['c']['username'],
                $result['d']['verificacion_fase_uno'],
                $result['d']['descripcion_verificacion_fase_uno'],
                $result['d']['visto_bueno'],
                $result['d']['descripcion_visto_bueno'],
                $result['d']['calificacion_caracteristicas_biofisicas'],
                $result['d']['concepto_biofisico_agrologico'],
                $result['d']['calificacion_sociales'],
                $result['d']['concepto_social'],
                $result['d']['calificacion_economicos'],
                $result['d']['concepto_economico'],
                $result['d']['calificacion_ambientales'],
                $result['d']['concepto_ambiental'],
                $result['d']['descripcion_vias_internas'],
                $result['d']['georeferenciacion'],
                $publicacion
            );

            $newRow = array();

            foreach ($row as $a) {
                $newRow[] = iconv('UTF-8', 'Windows-1252', $a);
            }

            fputcsv($csv_file, $newRow, ';', '"');
        }

        fclose($csv_file);
    }

    public function result_letter($id = null) {
        $this->layout = "pdf";
        $proyect_id = $this->Session->read('proy_id');
        $codigo = $this->Session->read('cod');
        if ($proyect_id == "") {
            $this->Session->setFlash('No ha seleccionado Proyecto');
            $this->redirect(array('controller' => 'Proyects', 'action' => 'index'));
        } else {
            $encuesta = $this->Poll->find('first', array('conditions' => array('Poll.id' => $id), 'fields' => array('Poll.aprobacion')));
            $this->set('aprobacion', $encuesta['Poll']['aprobacion']);
            App::Import('model', 'Proyect');
            $proyecto = new Proyect();
            $proyecto->Proposer->recursive = 0;
            $proyecto->recursive = 0;
            $this->set('pid', $proyect_id);
            $this->set('codigo', $codigo);
            $regionales = $proyecto->find('all', array('conditions' => array('Proyect.id' => $proyect_id), 'fields' => array('Branch.nombre', 'Branch.director')));
            $this->set('proponente', $proyecto->Proposer->find('all', array('conditions' => array('Proposer.proyect_id' => $proyect_id), 'fields' => array('Proposer.nombre', 'Proposer.direccion', 'City.name'))));
            $this->set('regionales', $regionales);
        }
    }

    public function index() {
        $proyect_id = $this->Session->read('proy_id');
        if ($proyect_id == "") {
            $this->Session->setFlash('No ha seleccionado un proyecto', 'flash_custom');
            $this->redirect(array('controller' => 'Pages', 'action' => 'display'));
        } else {
            if (($this->Session->read('fase1') == 1) OR ($this->Session->read('fase1') == 2)) {
                $this->Poll->recursive = -1;
                $this->set('proyect_id', $proyect_id);
                $this->set('polls', $this->Poll->find('all', array('order' => 'Poll.id DESC', 'conditions' => array('Poll.proyect_id' => $proyect_id), 'fields' => array('Poll.id', 'Poll.calificacion_caracteristicas_biofisicas', 'Poll.calificacion_sociales', 'Poll.calificacion_economicos', 'Poll.calificacion_ambientales', 'Poll.visto_bueno', 'Poll.verificacion_fase_uno', 'Poll.observaciones'))));
            } else {
                $this->Session->setFlash('Este Proyecto No Superó Fase Uno');
                $this->redirect(array('controller' => 'Pages', 'action' => 'display'));
            }
        }
    }

}

?>
